@serwist/webpack-plugin 8.4.1 → 8.4.2

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.d.cts CHANGED
@@ -1,2 +0,0 @@
1
- import { InjectManifest } from "./inject-manifest.js";
2
- export { InjectManifest };
@@ -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.4.1",
3
+ "version": "8.4.2",
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": [
@@ -61,7 +61,7 @@
61
61
  "dependencies": {
62
62
  "fast-json-stable-stringify": "2.1.0",
63
63
  "upath": "2.0.1",
64
- "@serwist/build": "8.4.1"
64
+ "@serwist/build": "8.4.2"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "webpack": "4.4.0 || ^5.9.0"
@@ -71,7 +71,7 @@
71
71
  "@types/webpack": "5.28.5",
72
72
  "pretty-bytes": "6.1.1",
73
73
  "rollup": "4.9.1",
74
- "@serwist/constants": "8.4.1"
74
+ "@serwist/constants": "8.4.2"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",