@ideasonpurpose/build-tools-wordpress 2.3.0 → 2.3.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.
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/config/webpack.config.js +23 -8
- package/lib/DependencyManifestPlugin.js +25 -5
- package/package.json +14 -12
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### v2.3.1
|
|
8
|
+
|
|
9
|
+
> 21 October 2025
|
|
10
|
+
|
|
11
|
+
- liveReload workaround for mini-css-extract-plugin HMR issues
|
|
12
|
+
- WIP updates
|
|
13
|
+
|
|
14
|
+
#### v2.3.0
|
|
15
|
+
|
|
16
|
+
> 19 October 2025
|
|
17
|
+
|
|
18
|
+
- Fixes and optimizations for multiple entry points
|
|
19
|
+
|
|
7
20
|
#### v2.2.6
|
|
8
21
|
|
|
9
22
|
> 18 October 2025
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ideasonpurpose/build-tools-wordpress
|
|
2
2
|
|
|
3
|
-
#### Version 2.3.
|
|
3
|
+
#### Version 2.3.2
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@ideasonpurpose/build-tools-wordpress)
|
|
6
6
|
[](https://github.com/ideasonpurpose/build-tools-wordpress#readme)
|
package/config/webpack.config.js
CHANGED
|
@@ -89,6 +89,8 @@ export default async (env) => {
|
|
|
89
89
|
|
|
90
90
|
const proxy = isProduction ? {} : await devserverProxy(config);
|
|
91
91
|
|
|
92
|
+
// console.log({config});
|
|
93
|
+
// console.log({entry: config.entry});
|
|
92
94
|
/**
|
|
93
95
|
* `usePolling` is a placeholder, try and detect native Windows Docker mounts
|
|
94
96
|
* since they don't support file-watching (no inotify events), if there's
|
|
@@ -120,6 +122,8 @@ export default async (env) => {
|
|
|
120
122
|
// const usePollingDebug = false; // Set to false to test without polling
|
|
121
123
|
// const pollIntervalDebug = 400;
|
|
122
124
|
|
|
125
|
+
// console.log({ entry: config.entry });
|
|
126
|
+
|
|
123
127
|
return {
|
|
124
128
|
stats,
|
|
125
129
|
module: {
|
|
@@ -136,7 +140,7 @@ export default async (env) => {
|
|
|
136
140
|
{
|
|
137
141
|
test: /\.(scss|css)$/,
|
|
138
142
|
use: [
|
|
139
|
-
|
|
143
|
+
MiniCssExtractPlugin.loader,
|
|
140
144
|
{
|
|
141
145
|
loader: "css-loader",
|
|
142
146
|
options: {
|
|
@@ -261,9 +265,17 @@ export default async (env) => {
|
|
|
261
265
|
host: "0.0.0.0",
|
|
262
266
|
allowedHosts: "all",
|
|
263
267
|
port: "auto",
|
|
268
|
+
|
|
264
269
|
hot: true, // Enable hot module replacement with fallback to full reload
|
|
270
|
+
|
|
271
|
+
// hot: "only",
|
|
272
|
+
static: {
|
|
273
|
+
watch: false,
|
|
274
|
+
},
|
|
275
|
+
|
|
265
276
|
client: {
|
|
266
|
-
logging: "
|
|
277
|
+
logging: "verbose",
|
|
278
|
+
// logging: "info",
|
|
267
279
|
overlay: {
|
|
268
280
|
errors: true,
|
|
269
281
|
warnings: true,
|
|
@@ -281,6 +293,10 @@ export default async (env) => {
|
|
|
281
293
|
index: false, // enable root proxying
|
|
282
294
|
|
|
283
295
|
writeToDisk: (filePath) => {
|
|
296
|
+
// // // SHORT_CIRCUIT FOR TESTING
|
|
297
|
+
// // console.log("DEBUG writeToDisk:", { filePath });
|
|
298
|
+
// return true;
|
|
299
|
+
|
|
284
300
|
/**
|
|
285
301
|
* Note: If this is an async function, it will write everything to disk
|
|
286
302
|
*
|
|
@@ -325,9 +341,9 @@ export default async (env) => {
|
|
|
325
341
|
}
|
|
326
342
|
|
|
327
343
|
// SHORT_CIRCUIT FOR TESTING
|
|
328
|
-
return true;
|
|
344
|
+
// return true;
|
|
329
345
|
|
|
330
|
-
console.log("DEBUG writeToDisk:", { filePath });
|
|
346
|
+
// console.log("DEBUG writeToDisk:", { filePath });
|
|
331
347
|
return false;
|
|
332
348
|
},
|
|
333
349
|
// stats,
|
|
@@ -386,6 +402,7 @@ export default async (env) => {
|
|
|
386
402
|
return middlewares;
|
|
387
403
|
},
|
|
388
404
|
|
|
405
|
+
liveReload: true,
|
|
389
406
|
watchFiles: {
|
|
390
407
|
paths: [
|
|
391
408
|
// Watch all PHP, HTML, SVG, and JSON files in the theme directory
|
|
@@ -398,10 +415,9 @@ export default async (env) => {
|
|
|
398
415
|
"**/node_modules/**",
|
|
399
416
|
"**/dist/**",
|
|
400
417
|
],
|
|
401
|
-
ignoreInitial: false,
|
|
418
|
+
ignoreInitial: false,
|
|
402
419
|
ignorePermissionErrors: true,
|
|
403
420
|
usePolling: false,
|
|
404
|
-
// interval: pollIntervalDebug,
|
|
405
421
|
},
|
|
406
422
|
},
|
|
407
423
|
|
|
@@ -419,6 +435,7 @@ export default async (env) => {
|
|
|
419
435
|
plugins: [
|
|
420
436
|
new MiniCssExtractPlugin({
|
|
421
437
|
filename: isProduction ? "[name]-[contenthash:8].css" : "[name].css",
|
|
438
|
+
runtime: false,
|
|
422
439
|
}),
|
|
423
440
|
|
|
424
441
|
new CopyPlugin({
|
|
@@ -452,8 +469,6 @@ export default async (env) => {
|
|
|
452
469
|
manifestFile: config.manifestFile,
|
|
453
470
|
}),
|
|
454
471
|
|
|
455
|
-
new WatchRunReporterPlugin(),
|
|
456
|
-
|
|
457
472
|
new AfterDoneReporterPlugin({
|
|
458
473
|
echo: env && env.WEBPACK_SERVE,
|
|
459
474
|
// message:
|
|
@@ -13,15 +13,26 @@ export class DependencyManifestPlugin {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
apply(compiler) {
|
|
16
|
+
|
|
17
|
+
// TODO: Switch this to tapPromise and make the function async
|
|
16
18
|
compiler.hooks.emit.tapAsync(this.name, (compilation, callback) => {
|
|
17
19
|
// const logger = compilation.getLogger("dependency-manifest-plugin");
|
|
18
|
-
|
|
19
20
|
// logger.info(compilation.namedChunkGroups.keys());
|
|
20
21
|
|
|
22
|
+
// console.log(
|
|
23
|
+
// "in DependencyManifestPlugin emit hook",
|
|
24
|
+
// Object.keys(compilation),
|
|
25
|
+
// );
|
|
26
|
+
|
|
27
|
+
console.log(Array.from(compilation.namedChunkGroups.keys()))
|
|
28
|
+
|
|
21
29
|
Array.from(compilation.namedChunkGroups.entries()).forEach(
|
|
22
30
|
([key, group]) => {
|
|
23
31
|
this.manifest[key] = group.chunks.reduce(
|
|
24
32
|
(entry, chunk) => {
|
|
33
|
+
|
|
34
|
+
// console.log({ files: Array.from(chunk.files) });
|
|
35
|
+
|
|
25
36
|
Array.from(chunk.files)
|
|
26
37
|
/**
|
|
27
38
|
* hot-update files will stomp on the main file, filter them out
|
|
@@ -29,13 +40,19 @@ export class DependencyManifestPlugin {
|
|
|
29
40
|
.filter((file) => !file.includes("hot-update"))
|
|
30
41
|
.forEach((file) => {
|
|
31
42
|
const { chunkGraph } = compilation;
|
|
43
|
+
|
|
44
|
+
// console.log({file})
|
|
32
45
|
const ext = path.extname(file);
|
|
33
46
|
|
|
34
47
|
const filepath = path.resolve(
|
|
35
48
|
compiler.options.output.publicPath,
|
|
36
|
-
file
|
|
49
|
+
file,
|
|
37
50
|
);
|
|
38
51
|
|
|
52
|
+
// const fullPath = path.resolve(compiler.options.output.path, file);
|
|
53
|
+
// const stats = fs.statSync(fullPath);
|
|
54
|
+
// console.log({ file, size: stats.size });
|
|
55
|
+
|
|
39
56
|
let silo, fileKey;
|
|
40
57
|
/**
|
|
41
58
|
* If the chunk has one or more entryModules, it's a file
|
|
@@ -51,13 +68,16 @@ export class DependencyManifestPlugin {
|
|
|
51
68
|
|
|
52
69
|
entry[silo][fileKey] = filepath;
|
|
53
70
|
});
|
|
71
|
+
// console.log({entry})
|
|
54
72
|
return entry;
|
|
55
73
|
},
|
|
56
|
-
{ files: {}, dependencies: {} }
|
|
74
|
+
{ files: {}, dependencies: {} },
|
|
57
75
|
);
|
|
58
|
-
}
|
|
76
|
+
},
|
|
59
77
|
);
|
|
60
78
|
|
|
79
|
+
console.log(this.manifest);
|
|
80
|
+
|
|
61
81
|
callback();
|
|
62
82
|
});
|
|
63
83
|
|
|
@@ -66,7 +86,7 @@ export class DependencyManifestPlugin {
|
|
|
66
86
|
return await fs.outputJSON(
|
|
67
87
|
path.resolve(compiler.options.output.path, this.config.manifestFile),
|
|
68
88
|
this.manifest,
|
|
69
|
-
{ spaces: 2 }
|
|
89
|
+
{ spaces: 2 },
|
|
70
90
|
);
|
|
71
91
|
}
|
|
72
92
|
console.log("in DependencyManifestPlugin afterEmit");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ideasonpurpose/build-tools-wordpress",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Build scripts and dependencies for IOP's WordPress development environments.",
|
|
5
5
|
"homepage": "https://github.com/ideasonpurpose/build-tools-wordpress#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -36,32 +36,33 @@
|
|
|
36
36
|
"@ideasonpurpose/prettier-config": "^1.0.1",
|
|
37
37
|
"@ideasonpurpose/stylelint-config": "^1.1.4",
|
|
38
38
|
"@prettier/plugin-php": "^0.24.0",
|
|
39
|
-
"@rollup/plugin-commonjs": "^
|
|
39
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
40
40
|
"@rollup/plugin-json": "^6.1.0",
|
|
41
41
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
42
42
|
"@svgr/webpack": "^8.1.0",
|
|
43
|
-
"@wordpress/dependency-extraction-webpack-plugin": "^6.
|
|
43
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.34.0",
|
|
44
44
|
"ansi-html": "^0.0.9",
|
|
45
45
|
"archiver": "^7.0.1",
|
|
46
46
|
"auto-changelog": "^2.5.0",
|
|
47
47
|
"autoprefixer": "^10.4.21",
|
|
48
48
|
"babel-loader": "^10.0.0",
|
|
49
|
-
"caniuse-lite": "^1.0.
|
|
49
|
+
"caniuse-lite": "^1.0.30001753",
|
|
50
50
|
"chalk": "^5.6.2",
|
|
51
51
|
"chalk-cli": "^6.0.0",
|
|
52
52
|
"classnames": "^2.5.1",
|
|
53
|
-
"cli-truncate": "^5.1.
|
|
53
|
+
"cli-truncate": "^5.1.1",
|
|
54
54
|
"copy-webpack-plugin": "^13.0.1",
|
|
55
55
|
"cosmiconfig": "^9.0.0",
|
|
56
56
|
"cross-env": "^10.1.0",
|
|
57
57
|
"css-loader": "^7.1.2",
|
|
58
|
-
"cssnano": "^7.1.
|
|
58
|
+
"cssnano": "^7.1.2",
|
|
59
59
|
"dotenv": "^17.2.3",
|
|
60
60
|
"esbuild-loader": "^4.4.0",
|
|
61
|
-
"eslint": "^9.
|
|
61
|
+
"eslint": "^9.39.0",
|
|
62
62
|
"filesize": "^11.0.13",
|
|
63
63
|
"fs-extra": "^11.3.2",
|
|
64
64
|
"globby": "^15.0.0",
|
|
65
|
+
"html-webpack-plugin": "^5.6.4",
|
|
65
66
|
"http-proxy": "^1.18.1",
|
|
66
67
|
"humanize-duration": "^3.33.1",
|
|
67
68
|
"image-minimizer-webpack-plugin": "^4.1.4",
|
|
@@ -76,8 +77,8 @@
|
|
|
76
77
|
"pretty-hrtime": "^1.0.3",
|
|
77
78
|
"read-package-up": "^11.0.0",
|
|
78
79
|
"replacestream": "^4.0.3",
|
|
79
|
-
"sass-embedded": "^1.93.
|
|
80
|
-
"sass-loader": "^16.0.
|
|
80
|
+
"sass-embedded": "^1.93.3",
|
|
81
|
+
"sass-loader": "^16.0.6",
|
|
81
82
|
"semver": "^7.7.3",
|
|
82
83
|
"sharp": "^0.34.4",
|
|
83
84
|
"sort-package-json": "^3.4.0",
|
|
@@ -89,14 +90,15 @@
|
|
|
89
90
|
"webpack": "^5.102.1",
|
|
90
91
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
91
92
|
"webpack-dev-middleware": "^7.4.5",
|
|
92
|
-
"webpack-dev-server": "^5.2.2"
|
|
93
|
+
"webpack-dev-server": "^5.2.2",
|
|
94
|
+
"webpack-manifest-plugin": "^6.0.1"
|
|
93
95
|
},
|
|
94
96
|
"peerDependencies": {
|
|
95
97
|
"webpack-cli": "^6.0.1"
|
|
96
98
|
},
|
|
97
99
|
"devDependencies": {
|
|
98
|
-
"@vitest/coverage-v8": "^
|
|
99
|
-
"vitest": "^
|
|
100
|
+
"@vitest/coverage-v8": "^4.0.6",
|
|
101
|
+
"vitest": "^4.0.6"
|
|
100
102
|
},
|
|
101
103
|
"version-everything": {
|
|
102
104
|
"files": [
|