@plaudit/webpack-extensions 2.20.1 → 2.21.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.
|
@@ -142,7 +142,7 @@ function disableDefaultURLProcessing(webpackConfig) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
function injectPostcssConfigOverrides(webpackConfig, variables, verbose
|
|
145
|
+
function injectPostcssConfigOverrides(webpackConfig, variables, verbose) {
|
|
146
146
|
if (webpackConfig.module?.rules) {
|
|
147
147
|
const postcssConfig = (0, static_configs_1.postcssConfigBuilder)(verbose, name => variables(name) ?? (name === 'ENV' ? '' : undefined));
|
|
148
148
|
return webpackConfig.module.rules.map(rule => {
|
|
@@ -163,7 +163,7 @@ function injectPostcssConfigOverrides(webpackConfig, variables, verbose, process
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
if (rule.test instanceof RegExp && (rule.test.test("index.ts") || rule.test.test("index.mts"))) { // Then this is the javascript and typescript rule
|
|
166
|
-
|
|
166
|
+
rule.test = /\.m?[jt]sx?$/; // This hacks in support for mjs and mts files
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
return rule;
|
|
@@ -197,7 +197,7 @@ function parseEntrypointsJSON(dir) {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
function processIndividualWebpackConfig(config, webpackConfig, sources) {
|
|
200
|
-
let scriptExtension;
|
|
200
|
+
let scriptExtension; // This is only used in non-block contexts. It might not actually be necessary, but it is good to have
|
|
201
201
|
let entrypointFields;
|
|
202
202
|
const processingModules = webpackConfig.output?.module ?? false;
|
|
203
203
|
if (processingModules) {
|
|
@@ -211,7 +211,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources) {
|
|
|
211
211
|
const { standaloneBlocks, variablesFilePath, verbose } = config;
|
|
212
212
|
let currentVariables = config.currentVariables;
|
|
213
213
|
disableDefaultURLProcessing(webpackConfig);
|
|
214
|
-
const fixedRules = injectPostcssConfigOverrides(webpackConfig, name => currentVariables[name], verbose
|
|
214
|
+
const fixedRules = injectPostcssConfigOverrides(webpackConfig, name => currentVariables[name], verbose);
|
|
215
215
|
return sources.map(([src, dest]) => {
|
|
216
216
|
const srcRoots = (typeof dest !== 'string' && dest.withLegacyBlocksIn
|
|
217
217
|
? [...src.split(','), ...resolveLegacyBlockScriptsInFolder(dest.withLegacyBlocksIn)]
|
|
@@ -363,7 +363,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources) {
|
|
|
363
363
|
},
|
|
364
364
|
resolve: {
|
|
365
365
|
...webpackConfig.resolve,
|
|
366
|
-
extensions:
|
|
366
|
+
extensions: ['.mjsx', '.mjs', '.mtsx', '.mts', '.jsx', '.tsx', '.ts', '...']
|
|
367
367
|
},
|
|
368
368
|
stats: config.stats,
|
|
369
369
|
plugins: copyFiles
|