@serwist/webpack-plugin 8.4.4 → 9.0.0-preview.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.
- package/dist/chunks/relative-to-output-path.js +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.internal.d.ts +3 -1
- package/dist/index.internal.d.ts.map +1 -0
- package/dist/index.internal.js +2 -2
- package/dist/index.js +16 -22
- package/dist/inject-manifest.d.ts +7 -3
- package/dist/inject-manifest.d.ts.map +1 -0
- package/dist/lib/child-compilation-plugin.d.ts +1 -0
- package/dist/lib/child-compilation-plugin.d.ts.map +1 -0
- package/dist/lib/get-asset-hash.d.ts +1 -0
- package/dist/lib/get-asset-hash.d.ts.map +1 -0
- package/dist/lib/get-manifest-entries-from-compilation.d.ts +2 -1
- package/dist/lib/get-manifest-entries-from-compilation.d.ts.map +1 -0
- package/dist/lib/get-script-files-for-chunks.d.ts +2 -1
- package/dist/lib/get-script-files-for-chunks.d.ts.map +1 -0
- package/dist/lib/get-sourcemap-asset-name.d.ts +2 -1
- package/dist/lib/get-sourcemap-asset-name.d.ts.map +1 -0
- package/dist/lib/relative-to-output-path.d.ts +5 -4
- package/dist/lib/relative-to-output-path.d.ts.map +1 -0
- package/dist/lib/resolve-webpack-url.d.ts +2 -1
- package/dist/lib/resolve-webpack-url.d.ts.map +1 -0
- package/package.json +24 -29
- package/src/index.internal.ts +4 -0
- package/src/index.ts +11 -0
- package/src/inject-manifest.ts +287 -0
- package/src/lib/child-compilation-plugin.ts +66 -0
- package/src/lib/get-asset-hash.ts +27 -0
- package/src/lib/get-manifest-entries-from-compilation.ts +214 -0
- package/src/lib/get-script-files-for-chunks.ts +38 -0
- package/src/lib/get-sourcemap-asset-name.ts +47 -0
- package/src/lib/relative-to-output-path.ts +29 -0
- package/src/lib/resolve-webpack-url.ts +27 -0
- package/dist/index.cjs +0 -579
- package/dist/index.d.cts +0 -0
- package/dist/index.internal.cjs +0 -54
- package/dist/index.internal.d.cts +0 -2
- package/dist/inject-manifest.d.cts +0 -0
- package/dist/lib/child-compilation-plugin.d.cts +0 -20
- package/dist/lib/get-asset-hash.d.cts +0 -8
- package/dist/lib/get-manifest-entries-from-compilation.d.cts +0 -6
- package/dist/lib/get-script-files-for-chunks.d.cts +0 -0
- package/dist/lib/get-sourcemap-asset-name.d.cts +0 -0
- package/dist/lib/relative-to-output-path.d.cts +0 -11
- package/dist/lib/resolve-webpack-url.d.cts +0 -12
- package/dist/relative-to-output-path.cjs +0 -22
- package/dist/relative-to-output-path.js +0 -20
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import upath from 'upath';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param compilation The webpack compilation.
|
|
5
|
+
* @param path The original path value.
|
|
6
|
+
*
|
|
7
|
+
* @returns If path was not absolute, the returns path as-is.
|
|
8
|
+
* Otherwise, returns path relative to the compilation's output path.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
*/ const relativeToOutputPath = (compilation, path)=>{
|
|
12
|
+
// See https://github.com/jantimon/html-webpack-plugin/pull/266/files#diff-168726dbe96b3ce427e7fedce31bb0bcR38
|
|
13
|
+
if (upath.resolve(path) === upath.normalize(path)) {
|
|
14
|
+
return upath.relative(compilation.options.output.path, path);
|
|
15
|
+
}
|
|
16
|
+
// Otherwise, return swDest as-is.
|
|
17
|
+
return path;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { relativeToOutputPath as r };
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/index.internal.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { ChildCompilationPlugin } from "./lib/child-compilation-plugin.js";
|
|
2
|
-
|
|
2
|
+
import { relativeToOutputPath } from "./lib/relative-to-output-path.js";
|
|
3
|
+
export { ChildCompilationPlugin, relativeToOutputPath };
|
|
4
|
+
//# sourceMappingURL=index.internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.internal.d.ts","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/index.internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import webpack from 'webpack';
|
|
2
|
-
import { r as relativeToOutputPath } from './relative-to-output-path.js';
|
|
2
|
+
import { r as relativeToOutputPath } from './chunks/relative-to-output-path.js';
|
|
3
3
|
import 'upath';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -49,4 +49,4 @@ import 'upath';
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export { ChildCompilationPlugin };
|
|
52
|
+
export { ChildCompilationPlugin, relativeToOutputPath };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import stringify from 'fast-json-stable-stringify';
|
|
|
3
3
|
import upath from 'upath';
|
|
4
4
|
import webpack from 'webpack';
|
|
5
5
|
import crypto from 'crypto';
|
|
6
|
-
import { r as relativeToOutputPath } from './relative-to-output-path.js';
|
|
6
|
+
import { r as relativeToOutputPath } from './chunks/relative-to-output-path.js';
|
|
7
7
|
|
|
8
8
|
const BYTE_UNITS = [
|
|
9
9
|
'B',
|
|
@@ -140,7 +140,7 @@ function prettyBytes(number, options) {
|
|
|
140
140
|
* @param paths File paths to join
|
|
141
141
|
* @returns Joined file path
|
|
142
142
|
* @private
|
|
143
|
-
*/
|
|
143
|
+
*/ const resolveWebpackURL = (publicPath, ...paths)=>{
|
|
144
144
|
// This is a change in webpack v5.
|
|
145
145
|
// See https://github.com/jantimon/html-webpack-plugin/pull/1516
|
|
146
146
|
if (publicPath === "auto") {
|
|
@@ -150,7 +150,7 @@ function prettyBytes(number, options) {
|
|
|
150
150
|
publicPath,
|
|
151
151
|
...paths
|
|
152
152
|
].join("");
|
|
153
|
-
}
|
|
153
|
+
};
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* For a given asset, checks whether at least one of the conditions matches.
|
|
@@ -162,7 +162,7 @@ function prettyBytes(number, options) {
|
|
|
162
162
|
* @param conditions
|
|
163
163
|
* @returns Whether or not at least one condition matches.
|
|
164
164
|
* @private
|
|
165
|
-
*/
|
|
165
|
+
*/ const checkConditions = (asset, compilation, conditions = [])=>{
|
|
166
166
|
for (const condition of conditions){
|
|
167
167
|
if (typeof condition === "function") {
|
|
168
168
|
return condition({
|
|
@@ -177,7 +177,7 @@ function prettyBytes(number, options) {
|
|
|
177
177
|
}
|
|
178
178
|
// We'll only get here if none of the conditions applied.
|
|
179
179
|
return false;
|
|
180
|
-
}
|
|
180
|
+
};
|
|
181
181
|
/**
|
|
182
182
|
* Returns the names of all the assets in all the chunks in a chunk group,
|
|
183
183
|
* if provided a chunk group name.
|
|
@@ -188,7 +188,7 @@ function prettyBytes(number, options) {
|
|
|
188
188
|
* @param chunkOrGroup
|
|
189
189
|
* @returns
|
|
190
190
|
* @private
|
|
191
|
-
*/
|
|
191
|
+
*/ const getNamesOfAssetsInChunkOrGroup = (compilation, chunkOrGroup)=>{
|
|
192
192
|
const chunkGroup = compilation.namedChunkGroups?.get(chunkOrGroup);
|
|
193
193
|
if (chunkGroup) {
|
|
194
194
|
const assetNames = [];
|
|
@@ -203,14 +203,14 @@ function prettyBytes(number, options) {
|
|
|
203
203
|
}
|
|
204
204
|
// If we get here, there's no chunkGroup or chunk with that name.
|
|
205
205
|
return null;
|
|
206
|
-
}
|
|
206
|
+
};
|
|
207
207
|
/**
|
|
208
208
|
* Returns the names of all the assets in a chunk.
|
|
209
209
|
*
|
|
210
210
|
* @param chunk
|
|
211
211
|
* @returns
|
|
212
212
|
* @private
|
|
213
|
-
*/
|
|
213
|
+
*/ const getNamesOfAssetsInChunk = (chunk)=>{
|
|
214
214
|
const assetNames = [];
|
|
215
215
|
assetNames.push(...chunk.files);
|
|
216
216
|
// This only appears to be set in webpack v5.
|
|
@@ -218,7 +218,7 @@ function prettyBytes(number, options) {
|
|
|
218
218
|
assetNames.push(...chunk.auxiliaryFiles);
|
|
219
219
|
}
|
|
220
220
|
return assetNames;
|
|
221
|
-
}
|
|
221
|
+
};
|
|
222
222
|
/**
|
|
223
223
|
* Filters the set of assets out, based on the configuration options provided:
|
|
224
224
|
* - chunks and excludeChunks, for chunkName-based criteria.
|
|
@@ -229,7 +229,7 @@ function prettyBytes(number, options) {
|
|
|
229
229
|
* @returns The assets that should be included in the manifest,
|
|
230
230
|
* based on the criteria provided.
|
|
231
231
|
* @private
|
|
232
|
-
*/
|
|
232
|
+
*/ const filterAssets = (compilation, config)=>{
|
|
233
233
|
const filteredAssets = new Set();
|
|
234
234
|
const assets = compilation.getAssets();
|
|
235
235
|
const allowedAssetNames = new Set();
|
|
@@ -287,8 +287,8 @@ function prettyBytes(number, options) {
|
|
|
287
287
|
filteredAssets.add(asset);
|
|
288
288
|
}
|
|
289
289
|
return filteredAssets;
|
|
290
|
-
}
|
|
291
|
-
async
|
|
290
|
+
};
|
|
291
|
+
const getManifestEntriesFromCompilation = async (compilation, config)=>{
|
|
292
292
|
const filteredAssets = filterAssets(compilation, config);
|
|
293
293
|
const { publicPath } = compilation.options.output;
|
|
294
294
|
const fileDetails = Array.from(filteredAssets).map((asset)=>{
|
|
@@ -317,7 +317,7 @@ async function getManifestEntriesFromCompilation(compilation, config) {
|
|
|
317
317
|
size,
|
|
318
318
|
sortedEntries
|
|
319
319
|
};
|
|
320
|
-
}
|
|
320
|
+
};
|
|
321
321
|
|
|
322
322
|
/**
|
|
323
323
|
* If our bundled swDest file contains a sourcemap, we would invalidate that
|
|
@@ -335,7 +335,7 @@ async function getManifestEntriesFromCompilation(compilation, config) {
|
|
|
335
335
|
* comment pointing to an asset present in the compilation, this will return the
|
|
336
336
|
* name of that asset. Otherwise, it will return undefined.
|
|
337
337
|
* @private
|
|
338
|
-
*/
|
|
338
|
+
*/ const getSourcemapAssetName = (compilation, swContents, swDest)=>{
|
|
339
339
|
const url = getSourceMapURL(swContents);
|
|
340
340
|
if (url) {
|
|
341
341
|
// Translate the relative URL to what the presumed name for the webpack
|
|
@@ -351,7 +351,7 @@ async function getManifestEntriesFromCompilation(compilation, config) {
|
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
return undefined;
|
|
354
|
-
}
|
|
354
|
+
};
|
|
355
355
|
|
|
356
356
|
// Used to keep track of swDest files written by *any* instance of this plugin.
|
|
357
357
|
// See https://github.com/GoogleChrome/workbox/issues/2181
|
|
@@ -508,13 +508,7 @@ const _generatedAssetNames = new Set();
|
|
|
508
508
|
*
|
|
509
509
|
* @private
|
|
510
510
|
*/ async handleMake(compilation, parentCompiler) {
|
|
511
|
-
|
|
512
|
-
this.config = validateWebpackInjectManifestOptions(this.config);
|
|
513
|
-
} catch (error) {
|
|
514
|
-
if (error instanceof Error) {
|
|
515
|
-
throw new Error(`Please check your ${this.constructor.name} plugin ` + `configuration:\n${error.message}`);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
511
|
+
this.config = await validateWebpackInjectManifestOptions(this.config);
|
|
518
512
|
this.config.swDest = relativeToOutputPath(compilation, this.config.swDest);
|
|
519
513
|
_generatedAssetNames.add(this.config.swDest);
|
|
520
514
|
if (this.config.compileSrc) {
|
|
@@ -22,7 +22,7 @@ import webpack from "webpack";
|
|
|
22
22
|
* });
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare class InjectManifest {
|
|
25
|
+
export declare class InjectManifest {
|
|
26
26
|
protected config: WebpackInjectManifestOptions;
|
|
27
27
|
private alreadyCalled;
|
|
28
28
|
/**
|
|
@@ -42,7 +42,11 @@ declare class InjectManifest {
|
|
|
42
42
|
*/
|
|
43
43
|
getManifestEntries(compilation: webpack.Compilation, config: WebpackInjectManifestOptions): Promise<{
|
|
44
44
|
size: number;
|
|
45
|
-
sortedEntries:
|
|
45
|
+
sortedEntries: {
|
|
46
|
+
revision: string | null;
|
|
47
|
+
url: string;
|
|
48
|
+
integrity?: string | undefined;
|
|
49
|
+
}[] | undefined;
|
|
46
50
|
manifestString: string;
|
|
47
51
|
}>;
|
|
48
52
|
/**
|
|
@@ -79,4 +83,4 @@ declare class InjectManifest {
|
|
|
79
83
|
*/
|
|
80
84
|
addAssets(compilation: webpack.Compilation): Promise<void>;
|
|
81
85
|
}
|
|
82
|
-
|
|
86
|
+
//# sourceMappingURL=inject-manifest.d.ts.map
|
|
@@ -0,0 +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,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;IAcxD;;;;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"}
|
|
@@ -18,3 +18,4 @@ export declare class ChildCompilationPlugin implements WebpackPluginInstance {
|
|
|
18
18
|
apply(compiler: webpack.Compiler): void;
|
|
19
19
|
performChildCompilation(compilation: webpack.Compilation, parentCompiler: webpack.Compiler): Promise<void>;
|
|
20
20
|
}
|
|
21
|
+
//# sourceMappingURL=child-compilation-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-compilation-plugin.d.ts","sourceRoot":"","sources":["../../src/lib/child-compilation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,qBAAqB;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;gBACjC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,6BAA6B;IAKjE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAO1B,uBAAuB,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAiCjH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-asset-hash.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,UAAW,KAAK,KAAG,MAAM,GAAG,IASpD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ManifestEntry, WebpackInjectManifestOptions } from "@serwist/build";
|
|
2
2
|
import type { Compilation } from "webpack";
|
|
3
|
-
export declare
|
|
3
|
+
export declare const getManifestEntriesFromCompilation: (compilation: Compilation, config: WebpackInjectManifestOptions) => Promise<{
|
|
4
4
|
size: number;
|
|
5
5
|
sortedEntries: ManifestEntry[] | undefined;
|
|
6
6
|
}>;
|
|
7
|
+
//# sourceMappingURL=get-manifest-entries-from-compilation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-manifest-entries-from-compilation.d.ts","sourceRoot":"","sources":["../../src/lib/get-manifest-entries-from-compilation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAe,aAAa,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAE/F,OAAO,KAAK,EAAgB,WAAW,EAAgB,MAAM,SAAS,CAAC;AAwKvE,eAAO,MAAM,iCAAiC,gBAC/B,WAAW,UAChB,4BAA4B;UACnB,MAAM;mBAAiB,aAAa,EAAE,GAAG,SAAS;EAgCpE,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { Compilation } from "webpack";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const getScriptFilesForChunks: (compilation: Compilation, chunkNames: string[]) => string[];
|
|
3
|
+
//# sourceMappingURL=get-script-files-for-chunks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-script-files-for-chunks.d.ts","sourceRoot":"","sources":["../../src/lib/get-script-files-for-chunks.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,SAAS,CAAC;AAIzD,eAAO,MAAM,uBAAuB,gBAAiB,WAAW,cAAc,MAAM,EAAE,KAAG,MAAM,EAwB9F,CAAC"}
|
|
@@ -16,4 +16,5 @@ import type { Compilation } from "webpack";
|
|
|
16
16
|
* name of that asset. Otherwise, it will return undefined.
|
|
17
17
|
* @private
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
19
|
+
export declare const getSourcemapAssetName: (compilation: Compilation, swContents: string, swDest: string) => string | undefined;
|
|
20
|
+
//# sourceMappingURL=get-sourcemap-asset-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sourcemap-asset-name.d.ts","sourceRoot":"","sources":["../../src/lib/get-sourcemap-asset-name.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,gBAAiB,WAAW,cAAc,MAAM,UAAU,MAAM,KAAG,MAAM,GAAG,SAiB7G,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Compilation } from "webpack";
|
|
2
2
|
/**
|
|
3
3
|
* @param compilation The webpack compilation.
|
|
4
|
-
* @param
|
|
4
|
+
* @param path The original path value.
|
|
5
5
|
*
|
|
6
|
-
* @returns If
|
|
7
|
-
* Otherwise, returns
|
|
6
|
+
* @returns If path was not absolute, the returns path as-is.
|
|
7
|
+
* Otherwise, returns path relative to the compilation's output path.
|
|
8
8
|
*
|
|
9
9
|
* @private
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare const relativeToOutputPath: (compilation: Compilation, path: string) => string;
|
|
12
|
+
//# sourceMappingURL=relative-to-output-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relative-to-output-path.d.ts","sourceRoot":"","sources":["../../src/lib/relative-to-output-path.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,gBAAiB,WAAW,QAAQ,MAAM,KAAG,MAQ7E,CAAC"}
|
|
@@ -9,4 +9,5 @@
|
|
|
9
9
|
* @returns Joined file path
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
|
-
export declare
|
|
12
|
+
export declare const resolveWebpackURL: (publicPath: string, ...paths: string[]) => string;
|
|
13
|
+
//# sourceMappingURL=resolve-webpack-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-webpack-url.d.ts","sourceRoot":"","sources":["../../src/lib/resolve-webpack-url.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,eAAgB,MAAM,YAAY,MAAM,EAAE,KAAG,MAO1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/webpack-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-preview.0",
|
|
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": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"src",
|
|
8
|
+
"dist"
|
|
9
9
|
],
|
|
10
10
|
"keywords": [
|
|
11
11
|
"serwist",
|
|
@@ -18,15 +18,14 @@
|
|
|
18
18
|
"file manifest"
|
|
19
19
|
],
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=18.0.0"
|
|
22
22
|
},
|
|
23
23
|
"author": "Google's Web DevRel Team, Serwist's Team",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"repository": "serwist/serwist",
|
|
26
26
|
"bugs": "https://github.com/serwist/serwist/issues",
|
|
27
27
|
"homepage": "https://serwist.pages.dev",
|
|
28
|
-
"
|
|
29
|
-
"main": "./dist/index.cjs",
|
|
28
|
+
"main": "./dist/index.js",
|
|
30
29
|
"types": "./dist/index.d.ts",
|
|
31
30
|
"typesVersions": {
|
|
32
31
|
"*": {
|
|
@@ -37,41 +36,37 @@
|
|
|
37
36
|
},
|
|
38
37
|
"exports": {
|
|
39
38
|
".": {
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"default": "./dist/index.js"
|
|
43
|
-
},
|
|
44
|
-
"require": {
|
|
45
|
-
"types": "./dist/index.d.cts",
|
|
46
|
-
"default": "./dist/index.cjs"
|
|
47
|
-
}
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"default": "./dist/index.js"
|
|
48
41
|
},
|
|
49
42
|
"./internal": {
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"default": "./dist/index.internal.js"
|
|
53
|
-
},
|
|
54
|
-
"require": {
|
|
55
|
-
"types": "./dist/index.internal.d.cts",
|
|
56
|
-
"default": "./dist/index.internal.cjs"
|
|
57
|
-
}
|
|
43
|
+
"types": "./dist/index.internal.d.ts",
|
|
44
|
+
"default": "./dist/index.internal.js"
|
|
58
45
|
},
|
|
59
46
|
"./package.json": "./package.json"
|
|
60
47
|
},
|
|
61
48
|
"dependencies": {
|
|
62
49
|
"fast-json-stable-stringify": "2.1.0",
|
|
63
50
|
"upath": "2.0.1",
|
|
64
|
-
"@serwist/build": "
|
|
65
|
-
},
|
|
66
|
-
"peerDependencies": {
|
|
67
|
-
"webpack": "4.4.0 || ^5.9.0"
|
|
51
|
+
"@serwist/build": "9.0.0-preview.0"
|
|
68
52
|
},
|
|
69
53
|
"devDependencies": {
|
|
70
|
-
"@types/node": "20.
|
|
54
|
+
"@types/node": "20.11.16",
|
|
71
55
|
"@types/webpack": "5.28.5",
|
|
72
56
|
"pretty-bytes": "6.1.1",
|
|
73
|
-
"rollup": "4.9.
|
|
74
|
-
"
|
|
57
|
+
"rollup": "4.9.6",
|
|
58
|
+
"typescript": "5.4.0-dev.20240203",
|
|
59
|
+
"webpack": "5.90.1",
|
|
60
|
+
"@serwist/constants": "9.0.0-preview.0"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"typescript": ">=5.0.0",
|
|
64
|
+
"webpack": "4.4.0 || ^5.9.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependenciesMeta": {
|
|
67
|
+
"typescript": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
75
70
|
},
|
|
76
71
|
"scripts": {
|
|
77
72
|
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { InjectManifest } from "./inject-manifest.js";
|
|
10
|
+
|
|
11
|
+
export { InjectManifest };
|