@plaudit/webpack-extensions 2.7.0 → 2.9.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.
|
@@ -18,7 +18,7 @@ class AdditionalDependencyInjectorPlugin {
|
|
|
18
18
|
}, compilationAssets => {
|
|
19
19
|
const assetSources = new Map();
|
|
20
20
|
for (const entrypoint of compilation.entrypoints.values()) {
|
|
21
|
-
const typeScriptOrigins = entrypoint.origins.filter(origin =>
|
|
21
|
+
const typeScriptOrigins = entrypoint.origins.filter(origin => /\.m?tsx?$/.test(origin.request));
|
|
22
22
|
if (typeScriptOrigins.length > 0) {
|
|
23
23
|
for (const chunk of entrypoint.chunks) {
|
|
24
24
|
for (const file of chunk.files) {
|
|
@@ -54,7 +54,7 @@ function resolveLegacyBlockScriptsInFolder(folder) {
|
|
|
54
54
|
}
|
|
55
55
|
return blockScriptEntrypoints;
|
|
56
56
|
}
|
|
57
|
-
const scriptExtension = /\.[jt]sx?$/;
|
|
57
|
+
const scriptExtension = /\.m?[jt]sx?$/;
|
|
58
58
|
const styleExtension = /\.(p?c|sa)ss$/;
|
|
59
59
|
function scriptOrStyleTest(entryPath) {
|
|
60
60
|
return scriptExtension.test(entryPath) ? "script" : (styleExtension.test(entryPath) ? "style" : "");
|
|
@@ -158,6 +158,9 @@ function injectPostcssConfigOverrides(webpackConfig, variables, verbose) {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
+
if (rule.test instanceof RegExp && rule.test.test("index.ts")) { // Then this is the javascript and typescript rule
|
|
162
|
+
rule.test = /\.m?[jt]sx?$/; // This hacks in support for mjs and mts files
|
|
163
|
+
}
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
166
|
}
|
|
@@ -300,7 +303,8 @@ module.exports = function (config, webpackConfig = require("@wordpress/scripts/c
|
|
|
300
303
|
mode: "production",
|
|
301
304
|
output: {
|
|
302
305
|
...webpackConfig.output,
|
|
303
|
-
path: joinPossiblyAbsolutePaths(process.cwd(), srcIsDirectory ? destPath : node_path_1.default.dirname(destPath))
|
|
306
|
+
path: joinPossiblyAbsolutePaths(process.cwd(), srcIsDirectory ? destPath : node_path_1.default.dirname(destPath)),
|
|
307
|
+
chunkFilename: 'webpack-chunks/[id].js',
|
|
304
308
|
},
|
|
305
309
|
stats: config.stats ?? 'errors-warnings',
|
|
306
310
|
plugins: copyFiles
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaudit/webpack-extensions",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublishOnly": "rm -rf build && mkdir build && tsc",
|
|
6
6
|
"build": "tsc",
|
|
@@ -12,33 +12,38 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
"./wordpress-scripts-wrapper": "./build/wordpress-scripts-wrapper.js"
|
|
14
14
|
},
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
"*": {
|
|
17
|
+
"wordpress-scripts-wrapper": ["build/wordpress-scripts-wrapper.d.ts"]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
15
20
|
"devDependencies": {
|
|
16
|
-
"@types/browser-sync-webpack-plugin": "^2.2.
|
|
17
|
-
"@types/node": "^20.
|
|
18
|
-
"@types/tapable": "^2.2.
|
|
19
|
-
"@types/webpack": "^5.28.
|
|
20
|
-
"@types/webpack-sources": "^3.2.
|
|
21
|
+
"@types/browser-sync-webpack-plugin": "^2.2.3",
|
|
22
|
+
"@types/node": "^20.7.0",
|
|
23
|
+
"@types/tapable": "^2.2.5",
|
|
24
|
+
"@types/webpack": "^5.28.3",
|
|
25
|
+
"@types/webpack-sources": "^3.2.1",
|
|
21
26
|
"postcss-load-config": "^4.0.1",
|
|
22
27
|
"postcss-loader": "^7.3.3",
|
|
23
28
|
"ts-node": "^10.9.1",
|
|
24
|
-
"typescript": "^5.
|
|
29
|
+
"typescript": "^5.2.2"
|
|
25
30
|
},
|
|
26
31
|
"dependencies": {
|
|
27
32
|
"@plaudit/postcss-color-function": "^5.0.0",
|
|
28
33
|
"@plaudit/postcss-silent-extend": "^3.0.0",
|
|
29
34
|
"@plaudit/postcss-strip-units": "^3.0.0",
|
|
30
35
|
"@plaudit/postcss-variables": "^1.0.0",
|
|
31
|
-
"@wordpress/scripts": "^26.
|
|
32
|
-
"autoprefixer": "^10.4.
|
|
36
|
+
"@wordpress/scripts": "^26.13.0",
|
|
37
|
+
"autoprefixer": "^10.4.16",
|
|
33
38
|
"browser-sync": "^2.29.3",
|
|
34
39
|
"browser-sync-webpack-plugin": "^2.3.0",
|
|
35
40
|
"clean-webpack-plugin": "^4.0.0",
|
|
36
41
|
"copy-webpack-plugin": "^11.0.0",
|
|
37
42
|
"cssnano": "^6.0.1",
|
|
38
|
-
"eslint": "^8.
|
|
39
|
-
"eslint-plugin-jsdoc": "^46.
|
|
43
|
+
"eslint": "^8.50.0",
|
|
44
|
+
"eslint-plugin-jsdoc": "^46.8.2",
|
|
40
45
|
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
|
41
|
-
"postcss": "^8.4.
|
|
46
|
+
"postcss": "^8.4.30",
|
|
42
47
|
"postcss-calc": "^9.0.1",
|
|
43
48
|
"postcss-discard-comments": "^6.0.0",
|
|
44
49
|
"postcss-fallback": "^0.1.0",
|
|
@@ -59,6 +64,6 @@
|
|
|
59
64
|
"react": "^18.2.0",
|
|
60
65
|
"react-dom": "^18.2.0",
|
|
61
66
|
"webpack": "^5.88.2",
|
|
62
|
-
"webpack-remove-empty-scripts": "^1.0.
|
|
67
|
+
"webpack-remove-empty-scripts": "^1.0.4"
|
|
63
68
|
}
|
|
64
69
|
}
|