@ideasonpurpose/build-tools-wordpress 2.0.6 → 2.1.0
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 +6 -0
- package/README.md +1 -1
- package/config/ideasonpurpose.config.js +0 -1
- package/config/webpack.config.js +3 -130
- package/lib/buildConfig.js +0 -27
- package/package.json +8 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ 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.0.6
|
|
8
|
+
|
|
9
|
+
> 20 March 2025
|
|
10
|
+
|
|
11
|
+
- try moving webpack-cli to peerDependencies
|
|
12
|
+
|
|
7
13
|
#### v2.0.5
|
|
8
14
|
|
|
9
15
|
> 20 March 2025
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ideasonpurpose/build-tools-wordpress
|
|
2
2
|
|
|
3
|
-
#### Version 2.0
|
|
3
|
+
#### Version 2.1.0
|
|
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
|
@@ -23,12 +23,6 @@ import {
|
|
|
23
23
|
import autoprefixer from "autoprefixer";
|
|
24
24
|
import cssnano from "cssnano";
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Sass flavors for conditional sass-loader implementations
|
|
28
|
-
*/
|
|
29
|
-
// import * as nodeSass from "sass";
|
|
30
|
-
// import * as dartSass from "sass-embedded";
|
|
31
|
-
|
|
32
26
|
// Experimenting with this
|
|
33
27
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
34
28
|
|
|
@@ -95,14 +89,6 @@ export default async (env) => {
|
|
|
95
89
|
|
|
96
90
|
const proxy = isProduction ? {} : await devserverProxy(config);
|
|
97
91
|
|
|
98
|
-
setTimeout(() =>
|
|
99
|
-
console.log(
|
|
100
|
-
chalk.magenta.bold("sass implementation"),
|
|
101
|
-
chalk.yellow.bold(config.sass),
|
|
102
|
-
// config.sass === "sass" ? nodeSass : dartSass,
|
|
103
|
-
),
|
|
104
|
-
);
|
|
105
|
-
|
|
106
92
|
/**
|
|
107
93
|
* `usePolling` is a placeholder, try and detect native Windows Docker mounts
|
|
108
94
|
* since they don't support file-watching (no inotify events), if there's
|
|
@@ -121,95 +107,19 @@ export default async (env) => {
|
|
|
121
107
|
|
|
122
108
|
const devtool = config.devtool || false;
|
|
123
109
|
|
|
124
|
-
const sassLibs = ["sass-embedded", "sass", "node-sass"];
|
|
125
|
-
const sassImplementation = sassLibs.includes(config.sass)
|
|
126
|
-
? { implementation: config.sass }
|
|
127
|
-
: {};
|
|
128
|
-
|
|
129
|
-
// console.log({
|
|
130
|
-
// metaurl: new URL("webpack/stats/index.html", import.meta.url),
|
|
131
|
-
// config,
|
|
132
|
-
// // devServerProxy: await devserverProxy(config),
|
|
133
|
-
// });
|
|
134
|
-
|
|
135
110
|
return {
|
|
136
|
-
// stats: "errors-warnings",
|
|
137
111
|
stats,
|
|
138
112
|
module: {
|
|
139
113
|
rules: [
|
|
140
|
-
// {
|
|
141
|
-
// test: /\.(js|jsx|mjs)$/,
|
|
142
|
-
// include: [
|
|
143
|
-
// path.resolve(config.src),
|
|
144
|
-
// path.resolve("../tools/node_modules"),
|
|
145
|
-
// path.resolve("../site/node_modules"),
|
|
146
|
-
// ],
|
|
147
|
-
// exclude: function (module) {
|
|
148
|
-
// const moduleRegex = new RegExp(
|
|
149
|
-
// `node_modules/(${config.transpileDependencies.join("|")})`
|
|
150
|
-
// );
|
|
151
|
-
// return /node_modules/.test(module) && !moduleRegex.test(module);
|
|
152
|
-
// },
|
|
153
|
-
|
|
154
|
-
// /**
|
|
155
|
-
// * EXPERIMENTAL!!
|
|
156
|
-
// * If JS compilation breaks, try reverting this first.
|
|
157
|
-
// */
|
|
158
|
-
// loader: "esbuild-loader",
|
|
159
|
-
// options: {
|
|
160
|
-
// loader: "jsx",
|
|
161
|
-
// target: "es2015",
|
|
162
|
-
// },
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Updated 2022-09, simpler
|
|
166
|
-
*/
|
|
167
114
|
{
|
|
168
115
|
test: /\.[jt]sx?$/,
|
|
169
|
-
// test: /\.js$/,
|
|
170
116
|
loader: "esbuild-loader",
|
|
171
117
|
options: {
|
|
172
118
|
loader: "jsx",
|
|
173
119
|
target: config.esTarget,
|
|
174
120
|
},
|
|
175
121
|
},
|
|
176
|
-
|
|
177
|
-
// test: /\.tsx?$/,
|
|
178
|
-
// loader: "esbuild-loader",
|
|
179
|
-
// options: {
|
|
180
|
-
// loader: "tsx",
|
|
181
|
-
// target: config.esTarget,
|
|
182
|
-
// },
|
|
183
|
-
// },
|
|
184
|
-
|
|
185
|
-
// use: {
|
|
186
|
-
// loader: "babel-loader",
|
|
187
|
-
// options: {
|
|
188
|
-
// cacheDirectory: !isProduction,
|
|
189
|
-
// sourceType: "unambiguous",
|
|
190
|
-
// plugins: [
|
|
191
|
-
// "@babel/plugin-syntax-dynamic-import",
|
|
192
|
-
// ...(isProduction
|
|
193
|
-
// ? []
|
|
194
|
-
// : ["@babel/plugin-transform-react-jsx-source"]),
|
|
195
|
-
// ],
|
|
196
|
-
// presets: [
|
|
197
|
-
// [
|
|
198
|
-
// "@babel/preset-env",
|
|
199
|
-
// {
|
|
200
|
-
// forceAllTransforms: true,
|
|
201
|
-
// useBuiltIns: "usage",
|
|
202
|
-
// configPath: config.src,
|
|
203
|
-
// corejs: 3,
|
|
204
|
-
// modules: false,
|
|
205
|
-
// debug: false,
|
|
206
|
-
// },
|
|
207
|
-
// ],
|
|
208
|
-
// "@babel/preset-react",
|
|
209
|
-
// ],
|
|
210
|
-
// },
|
|
211
|
-
// },
|
|
212
|
-
// },
|
|
122
|
+
|
|
213
123
|
{
|
|
214
124
|
test: /\.(scss|css)$/,
|
|
215
125
|
use: [
|
|
@@ -244,25 +154,14 @@ export default async (env) => {
|
|
|
244
154
|
{
|
|
245
155
|
loader: "sass-loader",
|
|
246
156
|
options: {
|
|
247
|
-
|
|
248
|
-
// implementation: config.sass === "sass" ? nodeSass : dartSass,
|
|
249
|
-
// implementation: nodeSass,
|
|
250
|
-
// implementation: await import(config.sass),
|
|
157
|
+
implementation: "sass-embedded",
|
|
251
158
|
sourceMap: !isProduction,
|
|
252
159
|
warnRuleAsWarning: true,
|
|
253
160
|
webpackImporter: false,
|
|
254
161
|
sassOptions: {
|
|
255
|
-
// api: "modern",
|
|
256
162
|
api: "modern-compiler",
|
|
257
163
|
|
|
258
|
-
|
|
259
|
-
// path.resolve(config.src, "sass"),
|
|
260
|
-
// path.resolve(config.src),
|
|
261
|
-
// // path.resolve("../site/node_modules"),
|
|
262
|
-
// path.resolve("node_modules"),
|
|
263
|
-
// ],
|
|
264
|
-
// style: "expanded",
|
|
265
|
-
// verbose: true,
|
|
164
|
+
loadPaths: [path.resolve(config.src, "sass")],
|
|
266
165
|
},
|
|
267
166
|
},
|
|
268
167
|
},
|
|
@@ -327,8 +226,6 @@ export default async (env) => {
|
|
|
327
226
|
"node_modules",
|
|
328
227
|
new URL("../../build-tools-wordpress/node_modules", import.meta.url)
|
|
329
228
|
.pathname,
|
|
330
|
-
// path.resolve("../tools/node_modules"),
|
|
331
|
-
// path.resolve("./node_modules"), // for local development when running outside of Docker
|
|
332
229
|
],
|
|
333
230
|
},
|
|
334
231
|
|
|
@@ -372,31 +269,7 @@ export default async (env) => {
|
|
|
372
269
|
},
|
|
373
270
|
},
|
|
374
271
|
reconnect: 30,
|
|
375
|
-
// webSocketURL: {
|
|
376
|
-
// port: parseInt(process.env.PORT), // external port, so websockets hit the right endpoint
|
|
377
|
-
// },
|
|
378
272
|
},
|
|
379
|
-
// webSocketServer: "ws",
|
|
380
|
-
// static: {
|
|
381
|
-
// // TODO: Should contentBase be `false` when there's a proxy?
|
|
382
|
-
// directory: path.join("/usr/src/site/", config.contentBase),
|
|
383
|
-
// /*
|
|
384
|
-
// * TODO: Poll options were enabled as a workaround for Docker-win volume inotify
|
|
385
|
-
// * issues. Looking to make this conditional...
|
|
386
|
-
// * Maybe defined `isWindows` or `hasiNotify` for assigning a value
|
|
387
|
-
// * Placeholder defined at the top of the file.
|
|
388
|
-
// * For now, `usePolling` is a boolean (set to true)
|
|
389
|
-
// * ref: https://github.com/docker/for-win/issues/56
|
|
390
|
-
// * https://www.npmjs.com/package/is-windows
|
|
391
|
-
// * TODO: Safe to remove?
|
|
392
|
-
// * TODO: Test on vanilla Windows (should now work in WSL)
|
|
393
|
-
// */
|
|
394
|
-
|
|
395
|
-
// watch: {
|
|
396
|
-
// poll: usePolling && pollInterval,
|
|
397
|
-
// ignored: ["node_modules", "vendor"],
|
|
398
|
-
// },
|
|
399
|
-
// },
|
|
400
273
|
|
|
401
274
|
devMiddleware: {
|
|
402
275
|
index: false, // enable root proxying
|
package/lib/buildConfig.js
CHANGED
|
@@ -32,7 +32,6 @@ const defaultConfig = {
|
|
|
32
32
|
|
|
33
33
|
contentBase: "/dist/", // TODO: Should this be false?
|
|
34
34
|
manifestFile: "./dependency-manifest.json",
|
|
35
|
-
sass: "sass-embedded",
|
|
36
35
|
esTarget: "es2020",
|
|
37
36
|
|
|
38
37
|
devtool: "source-map",
|
|
@@ -163,32 +162,6 @@ export async function buildConfig(configFile = { config: {} }) {
|
|
|
163
162
|
}, {});
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
/**
|
|
167
|
-
* Normalize the sass implementation, default to 'sass-embedded'
|
|
168
|
-
*
|
|
169
|
-
* Returns a known module name (string) which will be dynamically imported into the config
|
|
170
|
-
*/
|
|
171
|
-
const sassInput = config.sass.toString().toLowerCase();
|
|
172
|
-
const nodeSass = ["sass", "node-sass"];
|
|
173
|
-
config.sass = nodeSass.includes(sassInput) ? "sass" : "sass-embedded";
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Print a deprecation warning for node-sass
|
|
177
|
-
* @link https://sass-lang.com/blog/libsass-is-deprecated/
|
|
178
|
-
*/
|
|
179
|
-
if (sassInput === "node-sass") {
|
|
180
|
-
console.log(
|
|
181
|
-
"⚠️ ",
|
|
182
|
-
chalk.bold.yellow("NOTICE"),
|
|
183
|
-
chalk.yellow("NOTICE node-sass is no longer supported. The js-compiled"),
|
|
184
|
-
);
|
|
185
|
-
console.log(chalk.yellow(" dart-sass package will be used instead."));
|
|
186
|
-
console.log(
|
|
187
|
-
chalk.cyan(" https://sass-lang.com/blog/libsass-is-deprecated/"),
|
|
188
|
-
);
|
|
189
|
-
console.log(chalk.cyan(" https://www.npmjs.com/package/sass"));
|
|
190
|
-
}
|
|
191
|
-
|
|
192
165
|
/**
|
|
193
166
|
* Remap proxy: true to default value
|
|
194
167
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ideasonpurpose/build-tools-wordpress",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
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": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"prettier": "@ideasonpurpose/prettier-config",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ideasonpurpose/prettier-config": "^1.0.0",
|
|
36
|
-
"@ideasonpurpose/stylelint-config": "^1.1.
|
|
36
|
+
"@ideasonpurpose/stylelint-config": "^1.1.1",
|
|
37
37
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
38
38
|
"@rollup/plugin-json": "^6.1.0",
|
|
39
39
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"auto-changelog": "^2.5.0",
|
|
45
45
|
"autoprefixer": "^10.4.21",
|
|
46
46
|
"babel-loader": "^10.0.0",
|
|
47
|
-
"
|
|
48
|
-
"caniuse-lite": "^1.0.30001706",
|
|
47
|
+
"caniuse-lite": "^1.0.30001707",
|
|
49
48
|
"chalk": "^5.4.1",
|
|
50
49
|
"chalk-cli": "^5.0.1",
|
|
51
50
|
"classnames": "^2.5.1",
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
"cssnano": "^7.0.6",
|
|
58
57
|
"dotenv": "^16.4.7",
|
|
59
58
|
"esbuild-loader": "^4.3.0",
|
|
60
|
-
"eslint": "^9.
|
|
59
|
+
"eslint": "^9.23.0",
|
|
61
60
|
"filesize": "^10.1.6",
|
|
62
61
|
"fs-extra": "^11.3.0",
|
|
63
62
|
"globby": "^14.1.0",
|
|
@@ -74,8 +73,7 @@
|
|
|
74
73
|
"pretty-hrtime": "^1.0.3",
|
|
75
74
|
"read-package-up": "^11.0.0",
|
|
76
75
|
"replacestream": "^4.0.3",
|
|
77
|
-
"sass": "^1.86.
|
|
78
|
-
"sass-embedded": "^1.86.0",
|
|
76
|
+
"sass-embedded": "^1.86.1",
|
|
79
77
|
"sass-loader": "^16.0.5",
|
|
80
78
|
"semver": "^7.7.1",
|
|
81
79
|
"sharp": "^0.33.5",
|
|
@@ -88,14 +86,14 @@
|
|
|
88
86
|
"webpack": "^5.98.0",
|
|
89
87
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
90
88
|
"webpack-dev-middleware": "^7.4.2",
|
|
91
|
-
"webpack-dev-server": "^5.2.
|
|
89
|
+
"webpack-dev-server": "^5.2.1"
|
|
92
90
|
},
|
|
93
91
|
"peerDependencies": {
|
|
94
92
|
"webpack-cli": "^6.0.1"
|
|
95
93
|
},
|
|
96
94
|
"devDependencies": {
|
|
97
|
-
"@vitest/coverage-v8": "^3.
|
|
98
|
-
"vitest": "^3.
|
|
95
|
+
"@vitest/coverage-v8": "^3.1.1",
|
|
96
|
+
"vitest": "^3.1.1"
|
|
99
97
|
},
|
|
100
98
|
"version-everything": {
|
|
101
99
|
"files": [
|