@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
|
File without changes
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { WebpackPluginInstance } from "webpack";
|
|
2
|
-
import webpack from "webpack";
|
|
3
|
-
export interface ChildCompilationPluginOptions {
|
|
4
|
-
src: string;
|
|
5
|
-
dest: string;
|
|
6
|
-
plugins?: WebpackPluginInstance[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Compile a file by creating a child of the hooked compiler.
|
|
10
|
-
*
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
export declare class ChildCompilationPlugin implements WebpackPluginInstance {
|
|
14
|
-
src: string;
|
|
15
|
-
dest: string;
|
|
16
|
-
plugins: WebpackPluginInstance[] | undefined;
|
|
17
|
-
constructor({ src, dest, plugins }: ChildCompilationPluginOptions);
|
|
18
|
-
apply(compiler: webpack.Compiler): void;
|
|
19
|
-
performChildCompilation(compilation: webpack.Compilation, parentCompiler: webpack.Compiler): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ManifestEntry, WebpackInjectManifestOptions } from "@serwist/build";
|
|
2
|
-
import type { Compilation } from "webpack";
|
|
3
|
-
export declare function getManifestEntriesFromCompilation(compilation: Compilation, config: WebpackInjectManifestOptions): Promise<{
|
|
4
|
-
size: number;
|
|
5
|
-
sortedEntries: ManifestEntry[] | undefined;
|
|
6
|
-
}>;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Compilation } from "webpack";
|
|
2
|
-
/**
|
|
3
|
-
* @param compilation The webpack compilation.
|
|
4
|
-
* @param swDest The original swDest value.
|
|
5
|
-
*
|
|
6
|
-
* @returns If swDest was not absolute, the returns swDest as-is.
|
|
7
|
-
* Otherwise, returns swDest relative to the compilation's output path.
|
|
8
|
-
*
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare function relativeToOutputPath(compilation: Compilation, swDest: string): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves a url in the way that webpack would (with string concatenation)
|
|
3
|
-
*
|
|
4
|
-
* Use publicPath + filePath instead of url.resolve(publicPath, filePath) see:
|
|
5
|
-
* https://webpack.js.org/configuration/output/#output-publicpath
|
|
6
|
-
*
|
|
7
|
-
* @param publicPath The publicPath value from webpack's compilation.
|
|
8
|
-
* @param paths File paths to join
|
|
9
|
-
* @returns Joined file path
|
|
10
|
-
* @private
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolveWebpackURL(publicPath: string, ...paths: Array<string>): string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var upath = require('upath');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param compilation The webpack compilation.
|
|
7
|
-
* @param swDest The original swDest value.
|
|
8
|
-
*
|
|
9
|
-
* @returns If swDest was not absolute, the returns swDest as-is.
|
|
10
|
-
* Otherwise, returns swDest relative to the compilation's output path.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
*/ function relativeToOutputPath(compilation, swDest) {
|
|
14
|
-
// See https://github.com/jantimon/html-webpack-plugin/pull/266/files#diff-168726dbe96b3ce427e7fedce31bb0bcR38
|
|
15
|
-
if (upath.resolve(swDest) === upath.normalize(swDest)) {
|
|
16
|
-
return upath.relative(compilation.options.output.path, swDest);
|
|
17
|
-
}
|
|
18
|
-
// Otherwise, return swDest as-is.
|
|
19
|
-
return swDest;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.relativeToOutputPath = relativeToOutputPath;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import upath from 'upath';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @param compilation The webpack compilation.
|
|
5
|
-
* @param swDest The original swDest value.
|
|
6
|
-
*
|
|
7
|
-
* @returns If swDest was not absolute, the returns swDest as-is.
|
|
8
|
-
* Otherwise, returns swDest relative to the compilation's output path.
|
|
9
|
-
*
|
|
10
|
-
* @private
|
|
11
|
-
*/ function relativeToOutputPath(compilation, swDest) {
|
|
12
|
-
// See https://github.com/jantimon/html-webpack-plugin/pull/266/files#diff-168726dbe96b3ce427e7fedce31bb0bcR38
|
|
13
|
-
if (upath.resolve(swDest) === upath.normalize(swDest)) {
|
|
14
|
-
return upath.relative(compilation.options.output.path, swDest);
|
|
15
|
-
}
|
|
16
|
-
// Otherwise, return swDest as-is.
|
|
17
|
-
return swDest;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { relativeToOutputPath as r };
|