@plaudit/webpack-extensions 2.6.1 → 2.8.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) {
|
|
@@ -9,6 +9,7 @@ interface PlauditWordpressWebpackConfig {
|
|
|
9
9
|
variables?: Record<string, any>;
|
|
10
10
|
verbose?: boolean;
|
|
11
11
|
src: string[] | Record<string, string | AdvancedOutputConfig>;
|
|
12
|
+
stats?: Configuration['stats'];
|
|
12
13
|
}
|
|
13
14
|
declare const _default: (config: PlauditWordpressWebpackConfig, webpackConfig?: Configuration) => Configuration[];
|
|
14
15
|
export = _default;
|
|
@@ -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
|
}
|
|
@@ -302,6 +305,7 @@ module.exports = function (config, webpackConfig = require("@wordpress/scripts/c
|
|
|
302
305
|
...webpackConfig.output,
|
|
303
306
|
path: joinPossiblyAbsolutePaths(process.cwd(), srcIsDirectory ? destPath : node_path_1.default.dirname(destPath))
|
|
304
307
|
},
|
|
308
|
+
stats: config.stats ?? 'errors-warnings',
|
|
305
309
|
plugins: copyFiles
|
|
306
310
|
? plugins.map(plugin => plugin.constructor.name === 'CopyPlugin'
|
|
307
311
|
? new copy_webpack_plugin_1.default({ patterns: [{ from: standaloneBlocks ? '**/(block.json|*.(php|twig|svg))' : '**/(block.json|*.(asset\.php|svg))',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaudit/webpack-extensions",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublishOnly": "rm -rf build && mkdir build && tsc",
|
|
6
6
|
"build": "tsc",
|
|
@@ -12,11 +12,16 @@
|
|
|
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
21
|
"@types/browser-sync-webpack-plugin": "^2.2.2",
|
|
17
|
-
"@types/node": "^20.3
|
|
18
|
-
"@types/tapable": "^2.2.
|
|
19
|
-
"@types/webpack": "^5.28.
|
|
22
|
+
"@types/node": "^20.5.3",
|
|
23
|
+
"@types/tapable": "^2.2.4",
|
|
24
|
+
"@types/webpack": "^5.28.2",
|
|
20
25
|
"@types/webpack-sources": "^3.2.0",
|
|
21
26
|
"postcss-load-config": "^4.0.1",
|
|
22
27
|
"postcss-loader": "^7.3.3",
|
|
@@ -28,18 +33,19 @@
|
|
|
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.11.0",
|
|
37
|
+
"autoprefixer": "^10.4.15",
|
|
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": "^
|
|
43
|
+
"eslint": "^8.47.0",
|
|
44
|
+
"eslint-plugin-jsdoc": "^46.5.0",
|
|
40
45
|
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
|
41
|
-
"postcss": "^8.4.
|
|
46
|
+
"postcss": "^8.4.28",
|
|
42
47
|
"postcss-calc": "^9.0.1",
|
|
48
|
+
"postcss-discard-comments": "^6.0.0",
|
|
43
49
|
"postcss-fallback": "^0.1.0",
|
|
44
50
|
"postcss-functions": "^4.0.2",
|
|
45
51
|
"postcss-import": "^15.1.0",
|
|
@@ -57,10 +63,7 @@
|
|
|
57
63
|
"postcss-url": "^10.1.3",
|
|
58
64
|
"react": "^18.2.0",
|
|
59
65
|
"react-dom": "^18.2.0",
|
|
60
|
-
"webpack": "^5.88.
|
|
66
|
+
"webpack": "^5.88.2",
|
|
61
67
|
"webpack-remove-empty-scripts": "^1.0.3"
|
|
62
|
-
},
|
|
63
|
-
"resolutions": {
|
|
64
|
-
"eslint-plugin-jsdoc": "^43.1.1"
|
|
65
68
|
}
|
|
66
69
|
}
|