@serwist/webpack-plugin 9.0.0-preview.3 → 9.0.0-preview.5
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/dist/index.js
CHANGED
|
@@ -155,10 +155,9 @@ class InjectManifest {
|
|
|
155
155
|
this.config = config;
|
|
156
156
|
this.alreadyCalled = false;
|
|
157
157
|
}
|
|
158
|
-
propagateWebpackConfig(
|
|
158
|
+
propagateWebpackConfig() {
|
|
159
159
|
const parsedSwSrc = upath.parse(this.config.swSrc);
|
|
160
160
|
this.config = Object.assign({
|
|
161
|
-
mode: compiler.options.mode,
|
|
162
161
|
swDest: `${parsedSwSrc.name}.js`
|
|
163
162
|
}, this.config);
|
|
164
163
|
}
|
|
@@ -191,7 +190,7 @@ class InjectManifest {
|
|
|
191
190
|
};
|
|
192
191
|
}
|
|
193
192
|
apply(compiler) {
|
|
194
|
-
this.propagateWebpackConfig(
|
|
193
|
+
this.propagateWebpackConfig();
|
|
195
194
|
compiler.hooks.make.tapPromise(this.constructor.name, (compilation)=>this.handleMake(compilation, compiler).catch((error)=>{
|
|
196
195
|
compilation.errors.push(error);
|
|
197
196
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAMnE,OAAO,OAAO,MAAM,SAAS,CAAC;AAU9B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,cAAc;IACzB,SAAS,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC/C,OAAO,CAAC,aAAa,CAAU;IAE/B;;OAEG;gBACS,MAAM,EAAE,4BAA4B;IAKhD;;;;OAIG;IACH,sBAAsB,
|
|
1
|
+
{"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAMnE,OAAO,OAAO,MAAM,SAAS,CAAC;AAU9B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,cAAc;IACzB,SAAS,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC/C,OAAO,CAAC,aAAa,CAAU;IAE/B;;OAEG;gBACS,MAAM,EAAE,4BAA4B;IAKhD;;;;OAIG;IACH,sBAAsB,IAAI,IAAI;IAa9B;;;;OAIG;IACG,kBAAkB,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,4BAA4B;;;;;;;;;IAwC/F;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;IA4BvC;;;;;OAKG;IACG,uBAAuB,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiChH;;;;;OAKG;IACH,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;IAMxF;;;;;OAKG;IACG,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBnG;;;;OAIG;IACG,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAmDjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/webpack-plugin",
|
|
3
|
-
"version": "9.0.0-preview.
|
|
3
|
+
"version": "9.0.0-preview.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A plugin for your Webpack build process, helping you generate a manifest of local files that should be precached.",
|
|
6
6
|
"files": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"fast-json-stable-stringify": "2.1.0",
|
|
50
50
|
"pretty-bytes": "6.1.1",
|
|
51
51
|
"upath": "2.0.1",
|
|
52
|
-
"@serwist/build": "9.0.0-preview.
|
|
52
|
+
"@serwist/build": "9.0.0-preview.5"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "20.11.16",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"rollup": "4.9.6",
|
|
58
58
|
"typescript": "5.4.0-dev.20240206",
|
|
59
59
|
"webpack": "5.90.1",
|
|
60
|
-
"@serwist/constants": "9.0.0-preview.
|
|
60
|
+
"@serwist/constants": "9.0.0-preview.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"typescript": ">=5.0.0",
|
package/src/inject-manifest.ts
CHANGED
|
@@ -60,13 +60,12 @@ export class InjectManifest {
|
|
|
60
60
|
*
|
|
61
61
|
* @private
|
|
62
62
|
*/
|
|
63
|
-
propagateWebpackConfig(
|
|
63
|
+
propagateWebpackConfig(): void {
|
|
64
64
|
const parsedSwSrc = upath.parse(this.config.swSrc);
|
|
65
65
|
// Because this.config is listed last, properties that are already set
|
|
66
66
|
// there take precedence over derived properties from the compiler.
|
|
67
67
|
this.config = Object.assign(
|
|
68
68
|
{
|
|
69
|
-
mode: compiler.options.mode,
|
|
70
69
|
// Use swSrc with a hardcoded .js extension, in case swSrc is a .ts file.
|
|
71
70
|
swDest: `${parsedSwSrc.name}.js`,
|
|
72
71
|
},
|
|
@@ -125,7 +124,7 @@ export class InjectManifest {
|
|
|
125
124
|
* @private
|
|
126
125
|
*/
|
|
127
126
|
apply(compiler: webpack.Compiler): void {
|
|
128
|
-
this.propagateWebpackConfig(
|
|
127
|
+
this.propagateWebpackConfig();
|
|
129
128
|
|
|
130
129
|
compiler.hooks.make.tapPromise(this.constructor.name, (compilation) =>
|
|
131
130
|
this.handleMake(compilation, compiler).catch((error: webpack.WebpackError) => {
|