@serwist/webpack-plugin 8.2.0 → 8.4.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/index.cjs +1 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.internal.cjs +1 -1
- package/dist/index.internal.js +1 -1
- package/dist/index.js +1 -1
- package/dist/inject-manifest.d.cts +0 -82
- package/dist/lib/get-sourcemap-asset-name.d.cts +0 -19
- package/package.json +6 -5
- /package/dist/{relative-to-output-path-5MVPPhSi.js → relative-to-output-path.cjs} +0 -0
- /package/dist/{relative-to-output-path-pbrP9MDI.js → relative-to-output-path.js} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var stringify = require('fast-json-stable-stringify');
|
|
|
5
5
|
var upath = require('upath');
|
|
6
6
|
var webpack = require('webpack');
|
|
7
7
|
var crypto = require('crypto');
|
|
8
|
-
var relativeToOutputPath = require('./relative-to-output-path
|
|
8
|
+
var relativeToOutputPath = require('./relative-to-output-path.cjs');
|
|
9
9
|
|
|
10
10
|
const BYTE_UNITS = [
|
|
11
11
|
'B',
|
package/dist/index.d.cts
CHANGED
package/dist/index.internal.cjs
CHANGED
package/dist/index.internal.js
CHANGED
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
|
|
6
|
+
import { r as relativeToOutputPath } from './relative-to-output-path.js';
|
|
7
7
|
|
|
8
8
|
const BYTE_UNITS = [
|
|
9
9
|
'B',
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { WebpackInjectManifestOptions } from "@serwist/build";
|
|
2
|
-
import webpack from "webpack";
|
|
3
|
-
/**
|
|
4
|
-
* This class supports compiling a service worker file provided via `swSrc`,
|
|
5
|
-
* and injecting into that service worker a list of URLs and revision
|
|
6
|
-
* information for precaching based on the webpack asset pipeline.
|
|
7
|
-
*
|
|
8
|
-
* Use an instance of `InjectManifest` in the
|
|
9
|
-
* [`plugins` array](https://webpack.js.org/concepts/plugins/#usage) of a
|
|
10
|
-
* webpack config.
|
|
11
|
-
*
|
|
12
|
-
* In addition to injecting the manifest, this plugin will perform a compilation
|
|
13
|
-
* of the `swSrc` file, using the options from the main webpack configuration.
|
|
14
|
-
*
|
|
15
|
-
* ```
|
|
16
|
-
* // The following lists some common options; see the rest of the documentation
|
|
17
|
-
* // for the full set of options and defaults.
|
|
18
|
-
* new InjectManifest({
|
|
19
|
-
* exclude: [/.../, '...'],
|
|
20
|
-
* maximumFileSizeToCacheInBytes: ...,
|
|
21
|
-
* swSrc: '...',
|
|
22
|
-
* });
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
declare class InjectManifest {
|
|
26
|
-
protected config: WebpackInjectManifestOptions;
|
|
27
|
-
private alreadyCalled;
|
|
28
|
-
/**
|
|
29
|
-
* Creates an instance of InjectManifest.
|
|
30
|
-
*/
|
|
31
|
-
constructor(config: WebpackInjectManifestOptions);
|
|
32
|
-
/**
|
|
33
|
-
* @param compiler default compiler object passed from webpack
|
|
34
|
-
*
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
propagateWebpackConfig(compiler: webpack.Compiler): void;
|
|
38
|
-
/**
|
|
39
|
-
* `getManifestEntriesFromCompilation` with a few additional checks.
|
|
40
|
-
*
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
43
|
-
getManifestEntries(compilation: webpack.Compilation, config: WebpackInjectManifestOptions): Promise<{
|
|
44
|
-
size: number;
|
|
45
|
-
sortedEntries: import("@serwist/build").ManifestEntry[] | undefined;
|
|
46
|
-
manifestString: string;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* @param compiler default compiler object passed from webpack
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
apply(compiler: webpack.Compiler): void;
|
|
54
|
-
/**
|
|
55
|
-
* @param compilation The webpack compilation.
|
|
56
|
-
* @param parentCompiler The webpack parent compiler.
|
|
57
|
-
*
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
performChildCompilation(compilation: webpack.Compilation, parentCompiler: webpack.Compiler): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* @param compilation The webpack compilation.
|
|
63
|
-
* @param parentCompiler The webpack parent compiler.
|
|
64
|
-
*
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
addSrcToAssets(compilation: webpack.Compilation, parentCompiler: webpack.Compiler): void;
|
|
68
|
-
/**
|
|
69
|
-
* @param compilation The webpack compilation.
|
|
70
|
-
* @param parentCompiler The webpack parent compiler.
|
|
71
|
-
*
|
|
72
|
-
* @private
|
|
73
|
-
*/
|
|
74
|
-
handleMake(compilation: webpack.Compilation, parentCompiler: webpack.Compiler): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* @param compilation The webpack compilation.
|
|
77
|
-
*
|
|
78
|
-
* @private
|
|
79
|
-
*/
|
|
80
|
-
addAssets(compilation: webpack.Compilation): Promise<void>;
|
|
81
|
-
}
|
|
82
|
-
export { InjectManifest };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Compilation } from "webpack";
|
|
2
|
-
/**
|
|
3
|
-
* If our bundled swDest file contains a sourcemap, we would invalidate that
|
|
4
|
-
* mapping if we just replaced injectionPoint with the stringified manifest.
|
|
5
|
-
* Instead, we need to update the swDest contents as well as the sourcemap
|
|
6
|
-
* at the same time.
|
|
7
|
-
*
|
|
8
|
-
* See https://github.com/GoogleChrome/workbox/issues/2235
|
|
9
|
-
*
|
|
10
|
-
* @param compilation The current webpack compilation.
|
|
11
|
-
* @param swContents The contents of the swSrc file, which may or
|
|
12
|
-
* may not include a valid sourcemap comment.
|
|
13
|
-
* @param swDest The configured swDest value.
|
|
14
|
-
* @returns If the swContents contains a valid sourcemap
|
|
15
|
-
* comment pointing to an asset present in the compilation, this will return the
|
|
16
|
-
* name of that asset. Otherwise, it will return undefined.
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
export declare function getSourcemapAssetName(compilation: Compilation, swContents: string, swDest: string): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/webpack-plugin",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.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": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"repository": "serwist/serwist",
|
|
26
26
|
"bugs": "https://github.com/serwist/serwist/issues",
|
|
27
|
-
"homepage": "https://serwist.
|
|
27
|
+
"homepage": "https://serwist.pages.dev",
|
|
28
28
|
"module": "./dist/index.js",
|
|
29
29
|
"main": "./dist/index.cjs",
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
@@ -60,9 +60,8 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"fast-json-stable-stringify": "2.1.0",
|
|
63
|
-
"rollup": "4.9.1",
|
|
64
63
|
"upath": "2.0.1",
|
|
65
|
-
"@serwist/build": "8.
|
|
64
|
+
"@serwist/build": "8.4.0"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
67
|
"webpack": "4.4.0 || ^5.9.0"
|
|
@@ -71,10 +70,12 @@
|
|
|
71
70
|
"@types/node": "20.10.5",
|
|
72
71
|
"@types/webpack": "5.28.5",
|
|
73
72
|
"pretty-bytes": "6.1.1",
|
|
74
|
-
"
|
|
73
|
+
"rollup": "4.9.1",
|
|
74
|
+
"@serwist/constants": "8.4.0"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
|
|
78
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
78
79
|
"lint": "eslint src --ext ts,tsx,js,jsx,cjs,mjs",
|
|
79
80
|
"typecheck": "tsc"
|
|
80
81
|
}
|
|
File without changes
|
|
File without changes
|