@plaudit/webpack-extensions 2.45.0 → 2.45.1
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.
|
@@ -29,40 +29,18 @@ class ExtensionsConfigFileGeneratorPlugin {
|
|
|
29
29
|
await Promise.all(emissionPromises);
|
|
30
30
|
});
|
|
31
31
|
compiler.hooks.thisCompilation.tap(this.constructor.name, compilation => {
|
|
32
|
-
compilation.hooks.
|
|
33
|
-
name: `${this.constructor.name}_ProcessAssets`,
|
|
34
|
-
stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_ANALYSE
|
|
35
|
-
}, compilationAssets => {
|
|
36
|
-
const stats = compilation.getStats().toJson({
|
|
37
|
-
hash: true,
|
|
38
|
-
publicPath: true,
|
|
39
|
-
assets: true,
|
|
40
|
-
chunks: true,
|
|
41
|
-
modules: true,
|
|
42
|
-
source: true,
|
|
43
|
-
errorDetails: false,
|
|
44
|
-
timings: false
|
|
45
|
-
});
|
|
46
|
-
if (!stats.assets) {
|
|
47
|
-
throw new Error("Stats did not include assets despite them being requested");
|
|
48
|
-
}
|
|
49
|
-
if (!stats.modules) {
|
|
50
|
-
throw new Error("Stats did not include modules despite them being requested");
|
|
51
|
-
}
|
|
32
|
+
compilation.hooks.afterProcessAssets.tap(`${this.constructor.name}_ProcessAssets`, compilationAssets => {
|
|
52
33
|
const regex = /^(.+?)-((?:editor-|view-|)(?:style|script|script-module))\.(?:css|m?js)$/i;
|
|
53
34
|
const mapping = {};
|
|
54
|
-
for (const asset of
|
|
55
|
-
if ((asset.chunks?.length ?? -1) > 1 || !asset.size) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
35
|
+
for (const asset of Object.keys(compilationAssets)) {
|
|
58
36
|
let match;
|
|
59
|
-
if ((match = /^(.+?)-setup.php$/i.exec(asset
|
|
60
|
-
(mapping[match[1]] ?? (mapping[match[1]] = [{}]))[1] = `${asset
|
|
37
|
+
if ((match = /^(.+?)-setup.php$/i.exec(asset)) && match[1]) {
|
|
38
|
+
(mapping[match[1]] ?? (mapping[match[1]] = [{}]))[1] = `${asset}`;
|
|
61
39
|
}
|
|
62
|
-
else if ((match = regex.exec(asset
|
|
40
|
+
else if ((match = regex.exec(asset)) && match[1] && match[2]) {
|
|
63
41
|
const resourceInfo = (mapping[match[1]] ?? (mapping[match[1]] = [{}]))[0];
|
|
64
42
|
const key = match[2].replace(/-[sm]/gi, chars => chars.substring(1).toUpperCase());
|
|
65
|
-
(resourceInfo[key] ?? (resourceInfo[key] = [])).push([`plaudit_block-extension_${match[1]}-${match[2]}`, asset
|
|
43
|
+
(resourceInfo[key] ?? (resourceInfo[key] = [])).push([`plaudit_block-extension_${match[1]}-${match[2]}`, asset]);
|
|
66
44
|
}
|
|
67
45
|
}
|
|
68
46
|
compilation.emitAsset("mapping.config", new webpack_1.sources.RawSource((0, php_serializer_1.default)(mapping)));
|
|
@@ -538,7 +538,9 @@ function processIndividualWebpackConfig(config, webpackConfig, sources) {
|
|
|
538
538
|
name(_, chunks, cacheGroupKey) {
|
|
539
539
|
const chunkName = chunks.find(chunk => chunk.name)?.name;
|
|
540
540
|
// We use "__${cacheGroupKey}__" instead of "${cacheGroupKey}-" to make it easier to remove when generating the filename
|
|
541
|
-
|
|
541
|
+
const filename = `__${cacheGroupKey}__${node_path_1.default.basename(chunkName)}`;
|
|
542
|
+
const dirname = node_path_1.default.dirname(chunkName);
|
|
543
|
+
return dirname === '.' ? filename : `${dirname}/${filename}`;
|
|
542
544
|
}
|
|
543
545
|
},
|
|
544
546
|
default: false
|
package/package.json
CHANGED
|
@@ -1,76 +1,91 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
2
|
+
"name": "@plaudit/webpack-extensions",
|
|
3
|
+
"version": "2.45.1",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"prepublishOnly": "rm -rf build && mkdir build && tsc",
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"watch": "tsc -w"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"/build"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
"./wordpress-scripts-wrapper": "./build/wordpress-scripts-wrapper.js"
|
|
15
|
+
},
|
|
16
|
+
"typesVersions": {
|
|
17
|
+
"*": {
|
|
18
|
+
"wordpress-scripts-wrapper": [
|
|
19
|
+
"build/wordpress-scripts-wrapper.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@plaudit/gutenberg-api-extensions": "^2.66.1",
|
|
25
|
+
"@types/browser-sync-webpack-plugin": "^2.2.5",
|
|
26
|
+
"@types/node": "^22.15.3",
|
|
27
|
+
"@types/postcss-functions": "^4.0.4",
|
|
28
|
+
"@types/tapable": "^2.2.7",
|
|
29
|
+
"@types/webpack": "^5.28.5",
|
|
30
|
+
"@types/webpack-sources": "^3.2.3",
|
|
31
|
+
"postcss-load-config": "^4.0.2",
|
|
32
|
+
"postcss-loader": "^7.3.4",
|
|
33
|
+
"ts-node": "^10.9.2",
|
|
34
|
+
"typescript": "^5.8.3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@plaudit/postcss-color-function": "^5.0.0",
|
|
38
|
+
"@plaudit/postcss-legacy-shorthand": "^1.0.0",
|
|
39
|
+
"@plaudit/postcss-silent-extend": "^3.0.0",
|
|
40
|
+
"@plaudit/postcss-strip-units": "^3.0.0",
|
|
41
|
+
"@plaudit/postcss-variables": "^1.1.0",
|
|
42
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.22.0",
|
|
43
|
+
"@wordpress/scripts": "^30.15.0",
|
|
44
|
+
"autoprefixer": "^10.4.21",
|
|
45
|
+
"browser-sync": "^3.0.4",
|
|
46
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
47
|
+
"copy-webpack-plugin": "^10.2.4",
|
|
48
|
+
"cssnano": "^6.1.2",
|
|
49
|
+
"eslint-plugin-jsdoc": "^48.11.0",
|
|
50
|
+
"fork-ts-checker-webpack-plugin": "^9.1.0",
|
|
51
|
+
"http-proxy-middleware": "^3.0.5",
|
|
52
|
+
"json2php": "^0.0.12",
|
|
53
|
+
"postcss": "^8.5.3",
|
|
54
|
+
"postcss-calc": "^9.0.1",
|
|
55
|
+
"postcss-discard-comments": "^6.0.2",
|
|
56
|
+
"postcss-fallback": "^0.1.0",
|
|
57
|
+
"postcss-functions": "^4.0.2",
|
|
58
|
+
"postcss-import": "^16.1.0",
|
|
59
|
+
"postcss-inline-svg": "^6.0.0",
|
|
60
|
+
"postcss-media-minmax": "^5.0.0",
|
|
61
|
+
"postcss-mixins": "6.2.3",
|
|
62
|
+
"postcss-nested": "^6.2.0",
|
|
63
|
+
"postcss-property-lookup": "^3.0.0",
|
|
64
|
+
"postcss-quantity-queries": "^0.5.0",
|
|
65
|
+
"postcss-reporter": "^7.1.0",
|
|
66
|
+
"postcss-simple-vars": "^7.0.1",
|
|
67
|
+
"postcss-url": "^10.1.3",
|
|
68
|
+
"react": "^18.3.1",
|
|
69
|
+
"react-dom": "^18.3.1",
|
|
70
|
+
"webpack": "^5.99.7",
|
|
71
|
+
"webpack-remove-empty-scripts": "^1.0.4",
|
|
72
|
+
"xml-formatter": "^3.6.5"
|
|
73
|
+
},
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=20"
|
|
76
|
+
},
|
|
77
|
+
"pnpm": {
|
|
78
|
+
"onlyBuiltDependencies": [
|
|
79
|
+
"core-js",
|
|
80
|
+
"core-js-pure"
|
|
81
|
+
],
|
|
82
|
+
"ignoredBuiltDependencies": [
|
|
83
|
+
"@parcel/watcher"
|
|
84
|
+
],
|
|
85
|
+
"overrides": {
|
|
86
|
+
"micromatch": "^4",
|
|
87
|
+
"react-autosize-textarea>react": "*",
|
|
88
|
+
"react-autosize-textarea>react-dom": "*"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|