@plaudit/webpack-extensions 2.1.0 → 2.1.1
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.
|
@@ -19,19 +19,28 @@ class BlockJSONStyleRemappingPlugin {
|
|
|
19
19
|
errorDetails: false,
|
|
20
20
|
timings: false
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
if (!stats.assets) {
|
|
23
|
+
throw new Error("Stats did not include assets despite them being requested");
|
|
24
|
+
}
|
|
25
|
+
if (!stats.modules) {
|
|
26
|
+
throw new Error("Stats did not include modules despite them being requested");
|
|
27
|
+
}
|
|
28
|
+
const assetSourceFiles = new Map(stats.assets
|
|
29
|
+
.map(asset => [asset.name, asset.info?.sourceFilename])
|
|
30
|
+
.filter((v) => v[0] !== undefined && v[1] !== undefined));
|
|
31
|
+
const singleFileChunkToOutputName = new Map(stats.assets
|
|
32
|
+
.filter((asset) => asset.chunks?.length === 1)
|
|
26
33
|
.filter(asset => !asset.name.endsWith('.asset.php'))
|
|
27
|
-
.map(asset => [
|
|
28
|
-
const singleFileInputToOutputName = new Map(stats.modules
|
|
34
|
+
.map(asset => [asset.chunks[0], asset.name]));
|
|
35
|
+
const singleFileInputToOutputName = new Map(stats.modules
|
|
36
|
+
.map(module => {
|
|
29
37
|
if (module.nameForCondition !== undefined && module.chunks?.length === 1) {
|
|
30
|
-
const output = singleFileChunkToOutputName.get(
|
|
38
|
+
const output = singleFileChunkToOutputName.get(module.chunks[0]);
|
|
31
39
|
return output !== undefined ? [module.nameForCondition, output] : undefined;
|
|
32
40
|
}
|
|
33
41
|
return undefined;
|
|
34
|
-
})
|
|
42
|
+
})
|
|
43
|
+
.filter((v) => v !== undefined));
|
|
35
44
|
const remapValue = (value, name, dirname) => {
|
|
36
45
|
if (value.startsWith("file:")) {
|
|
37
46
|
const styleInputPath = node_path_1.default.normalize(node_path_1.default.join(compiler.context, dirname, value.substring(5)));
|