@atlassian/webresource-webpack-plugin 7.0.3 → 7.0.4-m001
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 +12 -0
- package/README.md +6 -3
- package/dist/AppResources.d.ts +8 -4
- package/dist/AppResources.js +17 -9
- package/dist/AppResources.js.map +1 -1
- package/dist/AppResourcesFactory.d.ts +1 -1
- package/dist/WebpackHelpers.d.ts +5 -5
- package/dist/WebpackHelpers.js +36 -54
- package/dist/WebpackHelpers.js.map +1 -1
- package/dist/WebpackRuntimeHelpers.d.ts +0 -2
- package/dist/WebpackRuntimeHelpers.js +1 -12
- package/dist/WebpackRuntimeHelpers.js.map +1 -1
- package/dist/WrmManifestPlugin.js.map +1 -1
- package/dist/WrmPlugin.d.ts +9 -3
- package/dist/WrmPlugin.js +140 -59
- package/dist/WrmPlugin.js.map +1 -1
- package/dist/deps/base-dependencies.js.map +1 -1
- package/dist/helpers/file-system.js +1 -2
- package/dist/helpers/file-system.js.map +1 -1
- package/dist/helpers/isRspackCompiler.d.ts +3 -0
- package/dist/helpers/isRspackCompiler.js +9 -0
- package/dist/helpers/isRspackCompiler.js.map +1 -0
- package/dist/helpers/options-parser.js +4 -1
- package/dist/helpers/options-parser.js.map +1 -1
- package/dist/helpers/renderCondition.js.map +1 -1
- package/dist/helpers/renderTransformations.d.ts +1 -1
- package/dist/helpers/renderTransformations.js.map +1 -1
- package/dist/helpers/web-resource-entrypoints.js.map +1 -1
- package/dist/helpers/web-resource-generator.js.map +1 -1
- package/dist/helpers/web-resource-parser.js.map +1 -1
- package/dist/helpers/xml.d.ts +2 -2
- package/dist/helpers/xml.js.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/types/extracted-webpack-types.d.ts +9 -9
- package/dist/types/types.d.ts +27 -27
- package/dist/webpack-modules/WrmResourceModule.js.map +1 -1
- package/jest.config.js +17 -3
- package/package.json +24 -20
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [7.0.4](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/webresource-webpack-plugin@7.0.4..@atlassian/webresource-webpack-plugin@7.0.3) (2025-08-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **BESECART-3480:** Move webpack plugin to [@atlassian](https://bitbucket.org/atlassian) scope ([cc62451](https://bitbucket.org/atlassianlabs/fe-server/commits/cc62451aabe8b63cf28645596e59ee8cef5ae560))
|
|
12
|
+
* **build:** newer TypeScript version reported issues ([3cebc02](https://bitbucket.org/atlassianlabs/fe-server/commits/3cebc02e3c68b7a6545cbbb24743f551be258df5))
|
|
13
|
+
* **lint:** update `eslint` and its plugins, update config files ([ff578f1](https://bitbucket.org/atlassianlabs/fe-server/commits/ff578f16057848f05fddbe87cff392acf5b863a2))
|
|
14
|
+
* **tests:** update Jest config and some of its dependencies after upgrade ([8f21350](https://bitbucket.org/atlassianlabs/fe-server/commits/8f21350ecd99d119341e877d7a8a6ea700e736c7))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
### [7.0.2](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/webresource-webpack-plugin@7.0.2..@atlassian/webresource-webpack-plugin@7.0.1) (2025-05-29)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @atlassian/webresource-webpack-plugin
|
package/README.md
CHANGED
|
@@ -612,13 +612,16 @@ The format of an external dependency mapping is as follows:
|
|
|
612
612
|
}
|
|
613
613
|
```
|
|
614
614
|
|
|
615
|
-
In this example, `externals` is a JSON object following the
|
|
616
|
-
[webpack externals format][webpack-externalobjects].
|
|
617
|
-
|
|
618
615
|
When your code is compiled through webpack, any occurrence of `dependency-name` found in a module import
|
|
619
616
|
statement will be replaced in the webpack output, and an appropriate web-resource `<dependency>` will be
|
|
620
617
|
added to the generated web-resource.
|
|
621
618
|
|
|
619
|
+
The `import` property is either a string or an object that specifies how the dependency should be imported in the code.
|
|
620
|
+
|
|
621
|
+
The provided object is a JSON object following the [webpack externals format][webpack-externalobjects].
|
|
622
|
+
|
|
623
|
+
If you’re not setting the `externalsType` or `library.type` in the config, then the default property being used is `var`. Another popular option is `amd` as most of the Atlassian products use AMD for loading modules (but then the `externalsType` should be set too).
|
|
624
|
+
|
|
622
625
|
### `wrmManifestPath` (Optional)
|
|
623
626
|
|
|
624
627
|
A path to a WRM manifest file where the plugin will store a map of objects.
|
package/dist/AppResources.d.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import type { Chunk, Compilation, Compiler } from 'webpack';
|
|
2
2
|
import type { Entrypoint } from './types/extracted-webpack-types';
|
|
3
|
-
import type { AssetNames, ChunkResourceDescriptor, ConsolidatedOptions } from './types/types';
|
|
4
|
-
|
|
3
|
+
import type { AssetNames, ChunkResourceDescriptor, ConsolidatedOptions, WrmResource } from './types/types';
|
|
4
|
+
type SplitChunkDependenciesKeyMap = Map<Chunk, {
|
|
5
5
|
key: string;
|
|
6
6
|
dependency: string;
|
|
7
7
|
}>;
|
|
8
|
-
export
|
|
8
|
+
export type AppResourceParams = {
|
|
9
9
|
assetsUUID: string;
|
|
10
10
|
assetNames: AssetNames;
|
|
11
11
|
options: ConsolidatedOptions;
|
|
12
12
|
compiler: Compiler;
|
|
13
13
|
compilation: Compilation;
|
|
14
|
+
dependencyModuleMap: Map<string, Set<string>>;
|
|
15
|
+
resourceModuleMap: Map<string, Set<WrmResource>>;
|
|
14
16
|
};
|
|
15
17
|
export default class AppResources {
|
|
16
18
|
private readonly assetsUUID;
|
|
17
19
|
private readonly compiler;
|
|
18
20
|
private readonly compilation;
|
|
21
|
+
private readonly dependencyModuleMap;
|
|
22
|
+
private readonly resourceModuleMap;
|
|
19
23
|
private assetNames;
|
|
20
24
|
private options;
|
|
21
25
|
/**
|
|
@@ -25,7 +29,7 @@ export default class AppResources {
|
|
|
25
29
|
* @param compiler Webpack compiler
|
|
26
30
|
* @param compilation Webpack compilation
|
|
27
31
|
*/
|
|
28
|
-
constructor({ assetsUUID, assetNames, options, compiler, compilation }: AppResourceParams);
|
|
32
|
+
constructor({ assetsUUID, assetNames, options, compiler, compilation, dependencyModuleMap, resourceModuleMap, }: AppResourceParams);
|
|
29
33
|
getSingleRuntimeFiles(): string[];
|
|
30
34
|
getAssetResourceDescriptor(): ChunkResourceDescriptor;
|
|
31
35
|
getDependencyResourcesFromChunk(chunk: Chunk): string[];
|
package/dist/AppResources.js
CHANGED
|
@@ -17,16 +17,18 @@ class AppResources {
|
|
|
17
17
|
* @param compiler Webpack compiler
|
|
18
18
|
* @param compilation Webpack compilation
|
|
19
19
|
*/
|
|
20
|
-
constructor({ assetsUUID, assetNames, options, compiler, compilation }) {
|
|
20
|
+
constructor({ assetsUUID, assetNames, options, compiler, compilation, dependencyModuleMap, resourceModuleMap, }) {
|
|
21
21
|
this.assetsUUID = assetsUUID;
|
|
22
22
|
this.assetNames = assetNames;
|
|
23
23
|
this.options = options;
|
|
24
24
|
this.compiler = compiler;
|
|
25
25
|
this.compilation = compilation;
|
|
26
|
+
this.dependencyModuleMap = dependencyModuleMap;
|
|
27
|
+
this.resourceModuleMap = resourceModuleMap;
|
|
26
28
|
}
|
|
27
29
|
getSingleRuntimeFiles() {
|
|
28
30
|
const files = this.getEntryPoints()
|
|
29
|
-
.map((entrypoint) =>
|
|
31
|
+
.map((entrypoint) => entrypoint.getRuntimeChunk()?.files)
|
|
30
32
|
.find(Boolean);
|
|
31
33
|
if (!files) {
|
|
32
34
|
return [];
|
|
@@ -89,9 +91,12 @@ class AppResources {
|
|
|
89
91
|
const additionalFileDeps = this.getDependencyResourcesFromChunk(c);
|
|
90
92
|
return {
|
|
91
93
|
attributes: syncSplitChunkDependencyKeyMap.get(c),
|
|
92
|
-
externalResources: (0, WebpackHelpers_1.
|
|
94
|
+
externalResources: (0, WebpackHelpers_1.getResourcesForChunks)(this.compilation, c, this.resourceModuleMap),
|
|
93
95
|
resources: (0, uniq_1.default)([...c.files, ...additionalFileDeps]),
|
|
94
|
-
dependencies: (0, uniq_1.default)([
|
|
96
|
+
dependencies: (0, uniq_1.default)([
|
|
97
|
+
...(0, base_dependencies_1.getBaseDependencies)(),
|
|
98
|
+
...(0, WebpackHelpers_1.getDependenciesForChunks)(this.compilation, c, this.dependencyModuleMap),
|
|
99
|
+
]),
|
|
95
100
|
};
|
|
96
101
|
});
|
|
97
102
|
}
|
|
@@ -100,9 +105,12 @@ class AppResources {
|
|
|
100
105
|
const additionalFileDeps = this.getDependencyResourcesFromChunk(c);
|
|
101
106
|
return {
|
|
102
107
|
attributes: { key: `${c.id}` },
|
|
103
|
-
externalResources: (0, WebpackHelpers_1.
|
|
108
|
+
externalResources: (0, WebpackHelpers_1.getResourcesForChunks)(this.compilation, c, this.resourceModuleMap),
|
|
104
109
|
resources: (0, uniq_1.default)([...c.files, ...additionalFileDeps]),
|
|
105
|
-
dependencies: (0, uniq_1.default)([
|
|
110
|
+
dependencies: (0, uniq_1.default)([
|
|
111
|
+
...(0, base_dependencies_1.getBaseDependencies)(),
|
|
112
|
+
...(0, WebpackHelpers_1.getDependenciesForChunks)(this.compilation, c, this.dependencyModuleMap),
|
|
113
|
+
]),
|
|
106
114
|
contexts: this.options.addAsyncNameAsContext && c.name ? [`async-chunk-${c.name}`] : undefined,
|
|
107
115
|
};
|
|
108
116
|
});
|
|
@@ -125,12 +133,12 @@ class AppResources {
|
|
|
125
133
|
const sharedSplitDeps = entrypointChunks
|
|
126
134
|
.map((c) => syncSplitChunkDependencyKeyMap.get(c))
|
|
127
135
|
.filter(Boolean)
|
|
128
|
-
.map((val) => val
|
|
136
|
+
.map((val) => val?.dependency);
|
|
129
137
|
// Construct the list of resources to add to this web-resource
|
|
130
138
|
const resourceList = (0, flatMap_1.default)(entrypointChunks, (c) => this.getDependencyResourcesFromChunk(c));
|
|
131
139
|
const dependencyList = [
|
|
132
140
|
...(0, base_dependencies_1.getBaseDependencies)(),
|
|
133
|
-
...(0, WebpackHelpers_1.getDependenciesForChunks)(this.compilation, runtimeChunk),
|
|
141
|
+
...(0, WebpackHelpers_1.getDependenciesForChunks)(this.compilation, runtimeChunk, this.dependencyModuleMap),
|
|
134
142
|
...sharedSplitDeps,
|
|
135
143
|
];
|
|
136
144
|
if (singleRuntime) {
|
|
@@ -145,7 +153,7 @@ class AppResources {
|
|
|
145
153
|
conditions: (0, web_resource_entrypoints_1.getConditionForEntry)(name, this.options.conditionMap),
|
|
146
154
|
dataProviders: (0, web_resource_entrypoints_1.getDataProvidersForEntry)(name, this.options.dataProvidersMap),
|
|
147
155
|
deprecationInfo: (0, web_resource_entrypoints_1.getDeprecationInfoForEntry)(name, this.options.deprecatedEntrypoints),
|
|
148
|
-
externalResources: (0, WebpackHelpers_1.
|
|
156
|
+
externalResources: (0, WebpackHelpers_1.getResourcesForChunks)(this.compilation, runtimeChunk, this.resourceModuleMap),
|
|
149
157
|
resources: (0, uniq_1.default)(resourceList),
|
|
150
158
|
dependencies: (0, uniq_1.default)(dependencyList).filter(Boolean),
|
|
151
159
|
};
|
package/dist/AppResources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppResources.js","sourceRoot":"","sources":["../src/AppResources.ts"],"names":[],"mappings":";;;;;AAAA,6DAAqC;AACrC,uDAA+B;AAG/B,gEAA+D;AAC/D,iFAM4C;AAG5C,
|
|
1
|
+
{"version":3,"file":"AppResources.js","sourceRoot":"","sources":["../src/AppResources.ts"],"names":[],"mappings":";;;;;AAAA,6DAAqC;AACrC,uDAA+B;AAG/B,gEAA+D;AAC/D,iFAM4C;AAG5C,qDAAuH;AAEvH,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAcxC,MAAqB,YAAY;IAU/B;;;;;;OAMG;IACH,YAAY,EACV,UAAU,EACV,UAAU,EACV,OAA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,sBAAsB;QACpB,OAAQ,EAAgC;aACrC,MAAM,CAAC,IAAI,CAAC,qCAAqC,EAAE,CAAC;aACpD,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,CAAC;aAChD,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,CAAC;aAChD,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF;AA/MD,+BA+MC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Compilation, Compiler } from 'webpack';
|
|
2
2
|
import type { AppResourceParams } from './AppResources';
|
|
3
3
|
import AppResources from './AppResources';
|
|
4
|
-
|
|
4
|
+
type AppResourcesFactoryParams = Omit<AppResourceParams, 'compiler' | 'compilation'>;
|
|
5
5
|
export default class AppResourceFactory {
|
|
6
6
|
private appResourcesFactoryParams;
|
|
7
7
|
constructor(appResourcesFactoryParams: AppResourcesFactoryParams);
|
package/dist/WebpackHelpers.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Chunk, Compilation, Compiler
|
|
1
|
+
import type { Chunk, Compilation, Compiler } from 'webpack';
|
|
2
2
|
import type { Entrypoint } from './types/extracted-webpack-types';
|
|
3
3
|
import type { WrmResource } from './types/types';
|
|
4
4
|
export declare const getAllAsyncChunks: (entryPoints: Entrypoint[]) => Chunk[];
|
|
5
|
-
export declare const getChunkModules: (compilation: Compilation, chunk: Chunk) => Module[];
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
5
|
+
export declare const getChunkModules: (compilation: Compilation, chunk: Chunk) => import("webpack").Module[];
|
|
6
|
+
export declare const getDependenciesForChunks: (compilation: Compilation, val: Chunk | Chunk[], dependencyModuleMap: Map<string, Set<string>>) => string[];
|
|
7
|
+
export declare const getResourcesForChunks: (compilation: Compilation, val: Chunk | Chunk[], resourceModuleMap: Map<string, Set<WrmResource>>) => WrmResource[];
|
|
8
8
|
export declare const isRunningInProductionMode: (compiler: Compiler) => boolean;
|
|
9
9
|
export declare const isSingleRuntime: (compiler: Compiler) => boolean;
|
|
10
10
|
export declare const extractLibraryDetailsFromWebpackConfig: (compiler: Compiler) => {
|
|
11
|
-
target: "module" | "import" | "var" | "
|
|
11
|
+
target: "module" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "promise" | "script" | "node-commonjs" | undefined;
|
|
12
12
|
name: undefined;
|
|
13
13
|
} | {
|
|
14
14
|
target: string;
|
package/dist/WebpackHelpers.js
CHANGED
|
@@ -1,71 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.extractLibraryDetailsFromWebpackConfig = exports.isSingleRuntime = exports.isRunningInProductionMode = exports.
|
|
7
|
-
const flatMap_1 = __importDefault(require("lodash/flatMap"));
|
|
8
|
-
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
9
|
-
const ProvidedExternalDependencyModule_1 = __importDefault(require("./webpack-modules/ProvidedExternalDependencyModule"));
|
|
10
|
-
const WrmDependencyModule_1 = __importDefault(require("./webpack-modules/WrmDependencyModule"));
|
|
11
|
-
const WrmResourceModule_1 = __importDefault(require("./webpack-modules/WrmResourceModule"));
|
|
12
|
-
function isWrmResourceModule(m) {
|
|
13
|
-
return m instanceof WrmResourceModule_1.default;
|
|
14
|
-
}
|
|
15
|
-
function isProvidedDependencyOrWrmDependency(m) {
|
|
16
|
-
return m instanceof ProvidedExternalDependencyModule_1.default || m instanceof WrmDependencyModule_1.default;
|
|
17
|
-
}
|
|
18
|
-
const _getExternalResourceModules = (compilation, chunk) => {
|
|
19
|
-
return (0, exports.getChunkModules)(compilation, chunk)
|
|
20
|
-
.filter(isWrmResourceModule)
|
|
21
|
-
.map((m) => m.getResource());
|
|
22
|
-
};
|
|
23
|
-
const _getExternalDependencyModules = (compilation, chunk) => {
|
|
24
|
-
return (0, exports.getChunkModules)(compilation, chunk)
|
|
25
|
-
.filter(isProvidedDependencyOrWrmDependency)
|
|
26
|
-
.sort((a, b) => {
|
|
27
|
-
return (
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
29
|
-
require('webpack/lib/util/comparators.js').compareModulesByPreOrderIndexOrIdentifier(compilation.moduleGraph)(a, b));
|
|
30
|
-
})
|
|
31
|
-
.map((m) => m.getDependency());
|
|
32
|
-
};
|
|
3
|
+
exports.extractLibraryDetailsFromWebpackConfig = exports.isSingleRuntime = exports.isRunningInProductionMode = exports.getResourcesForChunks = exports.getDependenciesForChunks = exports.getChunkModules = exports.getAllAsyncChunks = void 0;
|
|
33
4
|
const getAllAsyncChunks = (entryPoints) => {
|
|
34
|
-
const
|
|
35
|
-
const recursivelyGetAllAsyncChunks = (
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
5
|
+
const seenAsyncChunks = new Set();
|
|
6
|
+
const recursivelyGetAllAsyncChunks = (chunk) => {
|
|
7
|
+
const asyncChunks = [...(chunk.getAllAsyncChunks() || [])];
|
|
8
|
+
const unseen = asyncChunks.filter((ac) => {
|
|
9
|
+
if (seenAsyncChunks.has(ac)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
seenAsyncChunks.add(ac);
|
|
13
|
+
return true;
|
|
42
14
|
});
|
|
43
|
-
return
|
|
15
|
+
return [...unseen, ...unseen.flatMap((ac) => recursivelyGetAllAsyncChunks(ac))];
|
|
44
16
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return (0, uniq_1.default)(allAsyncChunks);
|
|
17
|
+
return entryPoints.flatMap((ep) => {
|
|
18
|
+
return recursivelyGetAllAsyncChunks(ep.getEntrypointChunk());
|
|
19
|
+
});
|
|
49
20
|
};
|
|
50
21
|
exports.getAllAsyncChunks = getAllAsyncChunks;
|
|
51
22
|
const getChunkModules = (compilation, chunk) => {
|
|
52
23
|
return compilation.chunkGraph.getChunkModules(chunk);
|
|
53
24
|
};
|
|
54
25
|
exports.getChunkModules = getChunkModules;
|
|
55
|
-
const
|
|
56
|
-
const externalResources = new Set();
|
|
57
|
-
for (const dep of _getExternalResourceModules(compilation, chunk)) {
|
|
58
|
-
externalResources.add(dep);
|
|
59
|
-
}
|
|
60
|
-
return Array.from(externalResources);
|
|
61
|
-
};
|
|
62
|
-
exports.getExternalResourcesForChunk = getExternalResourcesForChunk;
|
|
63
|
-
const getDependenciesForChunks = (compilation, val) => {
|
|
26
|
+
const getDependenciesForChunks = (compilation, val, dependencyModuleMap) => {
|
|
64
27
|
const chunks = Array.isArray(val) ? val : [val];
|
|
65
28
|
const externalDeps = new Set();
|
|
66
29
|
for (const chunk of chunks) {
|
|
67
|
-
for (const
|
|
68
|
-
|
|
30
|
+
for (const module of (0, exports.getChunkModules)(compilation, chunk)) {
|
|
31
|
+
const moduleKey = module.identifier();
|
|
32
|
+
const dependenciesForModule = [...(dependencyModuleMap.get(moduleKey) || [])];
|
|
33
|
+
for (const dep of dependenciesForModule) {
|
|
34
|
+
externalDeps.add(dep);
|
|
35
|
+
}
|
|
69
36
|
}
|
|
70
37
|
// TODO: figure out how to pass this "properly" as a module
|
|
71
38
|
// @ts-expect-error See WrmPlugin.ts where this is set.
|
|
@@ -76,6 +43,21 @@ const getDependenciesForChunks = (compilation, val) => {
|
|
|
76
43
|
return Array.from(externalDeps);
|
|
77
44
|
};
|
|
78
45
|
exports.getDependenciesForChunks = getDependenciesForChunks;
|
|
46
|
+
const getResourcesForChunks = (compilation, val, resourceModuleMap) => {
|
|
47
|
+
const chunks = Array.isArray(val) ? val : [val];
|
|
48
|
+
const additionalResources = new Set();
|
|
49
|
+
for (const chunk of chunks) {
|
|
50
|
+
for (const module of (0, exports.getChunkModules)(compilation, chunk)) {
|
|
51
|
+
const moduleKey = module.identifier();
|
|
52
|
+
const resourcesForModule = [...(resourceModuleMap.get(moduleKey) || [])];
|
|
53
|
+
for (const resource of resourcesForModule) {
|
|
54
|
+
additionalResources.add(resource);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return Array.from(additionalResources);
|
|
59
|
+
};
|
|
60
|
+
exports.getResourcesForChunks = getResourcesForChunks;
|
|
79
61
|
const isRunningInProductionMode = (compiler) => {
|
|
80
62
|
const { mode } = compiler.options;
|
|
81
63
|
return mode === 'production' || (mode === 'none' && process.env.NODE_ENV === 'production');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebpackHelpers.js","sourceRoot":"","sources":["../src/WebpackHelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WebpackHelpers.js","sourceRoot":"","sources":["../src/WebpackHelpers.ts"],"names":[],"mappings":";;;AAKO,MAAM,iBAAiB,GAAG,CAAC,WAAyB,EAAE,EAAE;IAC7D,MAAM,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;IAClC,MAAM,4BAA4B,GAAG,CAAC,KAAY,EAAW,EAAE;QAC7D,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE;YACvC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC5B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,4BAA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type { FactoryHandler } from './types/extracted-webpack-types';
|
|
3
|
-
export declare const hookIntoNormalModuleFactory: (stageName: string, compiler: Compiler, cb: FactoryHandler) => void;
|
|
4
2
|
export declare const hookIntoCompileDoneToGenerateReports: (stageName: string, compiler: Compiler, cb: (compilation: Compilation, callback: () => void) => void) => void;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hookIntoCompileDoneToGenerateReports =
|
|
4
|
-
const hookIntoNormalModuleFactory = (stageName, compiler, cb) => {
|
|
5
|
-
compiler.hooks.compile.tap(stageName, (params) => {
|
|
6
|
-
const hooks = params.normalModuleFactory.hooks;
|
|
7
|
-
const passThruFactory = (data, callback) => callback();
|
|
8
|
-
hooks.factorize.tapAsync({
|
|
9
|
-
name: stageName,
|
|
10
|
-
stage: 99,
|
|
11
|
-
}, cb(passThruFactory));
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
exports.hookIntoNormalModuleFactory = hookIntoNormalModuleFactory;
|
|
3
|
+
exports.hookIntoCompileDoneToGenerateReports = void 0;
|
|
15
4
|
const hookIntoCompileDoneToGenerateReports = (stageName, compiler, cb) => {
|
|
16
5
|
compiler.hooks.done.tapAsync(stageName, (stats, callback) => {
|
|
17
6
|
cb(stats.compilation, callback);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebpackRuntimeHelpers.js","sourceRoot":"","sources":["../src/WebpackRuntimeHelpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"WebpackRuntimeHelpers.js","sourceRoot":"","sources":["../src/WebpackRuntimeHelpers.ts"],"names":[],"mappings":";;;AAEO,MAAM,oCAAoC,GAAG,CAClD,SAAiB,EACjB,QAAkB,EAClB,EAA4D,EAC5D,EAAE;IACF,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC1D,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AARW,QAAA,oCAAoC,wCAQ/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrmManifestPlugin.js","sourceRoot":"","sources":["../src/WrmManifestPlugin.ts"],"names":[],"mappings":";;AAGA,wEAAuE;AACvE,uDAAsD;AACtD,qCAAiC;AAEjC,qDAA0E;AAC1E,mEAA+E;AAI/E,MAAqB,iBAAiB;IAKpC,YAAY,mBAAuC,EAAE,UAAkB,EAAE,SAAiB;QACxF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC5D,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAA,uDAAsC,EAAC,QAAQ,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"WrmManifestPlugin.js","sourceRoot":"","sources":["../src/WrmManifestPlugin.ts"],"names":[],"mappings":";;AAGA,wEAAuE;AACvE,uDAAsD;AACtD,qCAAiC;AAEjC,qDAA0E;AAC1E,mEAA+E;AAI/E,MAAqB,iBAAiB;IAKpC,YAAY,mBAAuC,EAAE,UAAkB,EAAE,SAAiB;QACxF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,UAAU,EAAE,mB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E,oBAAoB,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAE9F,IAAA,2BAAa,EAAC,UAAU,EAAE,eAAe,CAAC,CAAC;YAE3C,EAAE,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA9CD,oCA8CC"}
|
package/dist/WrmPlugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Compiler } from 'webpack';
|
|
2
|
-
import type { DataProvidersMap, Options, ProvidedDependenciesMap, ResourceParamMap, TransformationMap } from './types/types';
|
|
3
|
-
|
|
2
|
+
import type { DataProvidersMap, Options, ProvidedDependenciesMap, ResourceParamMap, TransformationMap, WrmResource } from './types/types';
|
|
3
|
+
type TransformerExtensions = {
|
|
4
4
|
[key: string]: string[];
|
|
5
5
|
};
|
|
6
6
|
declare class WrmPlugin {
|
|
@@ -32,7 +32,13 @@ declare class WrmPlugin {
|
|
|
32
32
|
ensureDataProvidersMapIsValid(dataProvidersMap: DataProvidersMap): DataProvidersMap;
|
|
33
33
|
checkConfig(compiler: Compiler): void;
|
|
34
34
|
overwritePublicPath(compiler: Compiler): void;
|
|
35
|
-
|
|
35
|
+
dependencyModuleMap: Map<string, Set<string>>;
|
|
36
|
+
resourceModuleMap: Map<string, Set<WrmResource>>;
|
|
37
|
+
dependencyIssuerMap: Map<string, Set<string>>;
|
|
38
|
+
resourceIssuerMap: Map<string, Set<WrmResource>>;
|
|
39
|
+
private storeMapEntryInValueSet;
|
|
40
|
+
private storeModuleDependency;
|
|
41
|
+
hookUpModuleDependencies(compiler: Compiler): void;
|
|
36
42
|
injectWRMSpecificRequestTypes(compiler: Compiler): void;
|
|
37
43
|
/**
|
|
38
44
|
* Ensure the WRM.require function is available at runtime and is used to load any code-split chunks.
|