@plaudit/webpack-extensions 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,7 +15,7 @@ class AdditionalDependencyInjectorPlugin {
|
|
|
15
15
|
stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_ANALYSE
|
|
16
16
|
}, compilationAssets => {
|
|
17
17
|
for (const [name, asset] of Object.entries(compilationAssets)) {
|
|
18
|
-
if (name.endsWith(".asset.php") && asset
|
|
18
|
+
if (name.endsWith(".asset.php") && asset.constructor.name === 'RawSource') {
|
|
19
19
|
const extensionlessName = name.substring(0, name.length - 10);
|
|
20
20
|
const additionalDependencies = [];
|
|
21
21
|
dependencyFinder: for (const srcRoot of compilation.contextDependencies) {
|
|
@@ -44,8 +44,8 @@ class BlockJSONStyleRemappingPlugin {
|
|
|
44
44
|
return value;
|
|
45
45
|
};
|
|
46
46
|
const mappableKeys = ["editorStyle", "style", "viewStyle", "viewScript", "script", "editorScript"];
|
|
47
|
-
|
|
48
|
-
if (name.endsWith("block.json") && asset
|
|
47
|
+
for (const [name, asset] of Object.entries(compilationAssets)) {
|
|
48
|
+
if (name.endsWith("block.json") && asset.constructor.name === 'RawSource') {
|
|
49
49
|
const dirname = node_path_1.default.dirname(assetSourceFiles.get(name) ?? name);
|
|
50
50
|
const json = JSON.parse(asset.source());
|
|
51
51
|
for (const mappableKey of mappableKeys) {
|
|
@@ -61,7 +61,7 @@ class BlockJSONStyleRemappingPlugin {
|
|
|
61
61
|
}
|
|
62
62
|
compilation.updateAsset(name, new webpack_sources_1.RawSource(JSON.stringify(json, undefined, " ")));
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -65,8 +65,8 @@ function default_1(config, webpackConfig = require("@wordpress/scripts/config/we
|
|
|
65
65
|
zindex: false,
|
|
66
66
|
filterPlugins: false // I don't know where this one came from. It is not listed in the documentation.
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const postcssLoader = require.resolve('postcss-loader');
|
|
69
|
+
if (postcssLoader && webpackConfig.module?.rules) {
|
|
70
70
|
// Options: calc
|
|
71
71
|
const calcOptions = { precision: 4, mediaQueries: true, selectors: true };
|
|
72
72
|
// Options: autoprefixerOptions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaudit/webpack-extensions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublishOnly": "rm -rf build && mkdir build && tsc",
|
|
6
6
|
"build": "tsc",
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
"./wordpress-scripts-wrapper": "./build/wordpress-scripts-wrapper.js"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@types/node": "^18.15.13",
|
|
16
17
|
"@types/webpack": "^5.28.1",
|
|
17
18
|
"@types/webpack-sources": "^3.2.0",
|
|
18
|
-
"postcss-load-config": "^4.0.1",
|
|
19
19
|
"postcss-loader": "^7.2.4",
|
|
20
|
+
"postcss-load-config": "^4.0.1",
|
|
20
21
|
"typescript": "^5.0.4"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
@@ -24,10 +25,10 @@
|
|
|
24
25
|
"@plaudit/postcss-silent-extend": "^3.0.0",
|
|
25
26
|
"@plaudit/postcss-strip-units": "^3.0.0",
|
|
26
27
|
"@plaudit/postcss-variables": "^1.0.0",
|
|
27
|
-
"@types/node": "^18.15.13",
|
|
28
28
|
"@wordpress/scripts": "^26.2.0",
|
|
29
29
|
"autoprefixer": "^10.4.14",
|
|
30
30
|
"clean-webpack-plugin": "^4.0.0",
|
|
31
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
31
32
|
"cssnano": "^6.0.0",
|
|
32
33
|
"eslint": "^8.38.0",
|
|
33
34
|
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
|
@@ -48,18 +49,10 @@
|
|
|
48
49
|
"postcss-short-spacing": "^4.0.0",
|
|
49
50
|
"react": "^18.2.0",
|
|
50
51
|
"react-dom": "^18.2.0",
|
|
51
|
-
"ts-node": "^10.9.1",
|
|
52
52
|
"webpack": "^5.80.0",
|
|
53
53
|
"webpack-remove-empty-scripts": "^1.0.3",
|
|
54
54
|
"webpack-sources": "^3.2.3"
|
|
55
55
|
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"copy-webpack-plugin": "^11.0.0",
|
|
58
|
-
"postcss-load-config": "^4.0.1",
|
|
59
|
-
"postcss-loader": "^7.2.4",
|
|
60
|
-
"webpack": "^5.80.0",
|
|
61
|
-
"webpack-sources": "^3.2.3"
|
|
62
|
-
},
|
|
63
56
|
"resolutions": {
|
|
64
57
|
"eslint-plugin-jsdoc": "^43.0.7"
|
|
65
58
|
}
|