@serwist/webpack-plugin 8.4.4 → 9.0.0-preview.1

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.
Files changed (48) hide show
  1. package/dist/chunks/relative-to-output-path.js +10 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.internal.d.ts +3 -1
  5. package/dist/index.internal.d.ts.map +1 -0
  6. package/dist/index.internal.js +3 -7
  7. package/dist/index.js +29 -317
  8. package/dist/inject-manifest.d.ts +7 -3
  9. package/dist/inject-manifest.d.ts.map +1 -0
  10. package/dist/lib/child-compilation-plugin.d.ts +1 -0
  11. package/dist/lib/child-compilation-plugin.d.ts.map +1 -0
  12. package/dist/lib/get-asset-hash.d.ts +1 -0
  13. package/dist/lib/get-asset-hash.d.ts.map +1 -0
  14. package/dist/lib/get-manifest-entries-from-compilation.d.ts +2 -1
  15. package/dist/lib/get-manifest-entries-from-compilation.d.ts.map +1 -0
  16. package/dist/lib/get-script-files-for-chunks.d.ts +2 -1
  17. package/dist/lib/get-script-files-for-chunks.d.ts.map +1 -0
  18. package/dist/lib/get-sourcemap-asset-name.d.ts +2 -1
  19. package/dist/lib/get-sourcemap-asset-name.d.ts.map +1 -0
  20. package/dist/lib/relative-to-output-path.d.ts +5 -4
  21. package/dist/lib/relative-to-output-path.d.ts.map +1 -0
  22. package/dist/lib/resolve-webpack-url.d.ts +2 -1
  23. package/dist/lib/resolve-webpack-url.d.ts.map +1 -0
  24. package/package.json +24 -29
  25. package/src/index.internal.ts +4 -0
  26. package/src/index.ts +11 -0
  27. package/src/inject-manifest.ts +287 -0
  28. package/src/lib/child-compilation-plugin.ts +66 -0
  29. package/src/lib/get-asset-hash.ts +27 -0
  30. package/src/lib/get-manifest-entries-from-compilation.ts +214 -0
  31. package/src/lib/get-script-files-for-chunks.ts +38 -0
  32. package/src/lib/get-sourcemap-asset-name.ts +47 -0
  33. package/src/lib/relative-to-output-path.ts +29 -0
  34. package/src/lib/resolve-webpack-url.ts +27 -0
  35. package/dist/index.cjs +0 -579
  36. package/dist/index.d.cts +0 -0
  37. package/dist/index.internal.cjs +0 -54
  38. package/dist/index.internal.d.cts +0 -2
  39. package/dist/inject-manifest.d.cts +0 -0
  40. package/dist/lib/child-compilation-plugin.d.cts +0 -20
  41. package/dist/lib/get-asset-hash.d.cts +0 -8
  42. package/dist/lib/get-manifest-entries-from-compilation.d.cts +0 -6
  43. package/dist/lib/get-script-files-for-chunks.d.cts +0 -0
  44. package/dist/lib/get-sourcemap-asset-name.d.cts +0 -0
  45. package/dist/lib/relative-to-output-path.d.cts +0 -11
  46. package/dist/lib/resolve-webpack-url.d.cts +0 -12
  47. package/dist/relative-to-output-path.cjs +0 -22
  48. package/dist/relative-to-output-path.js +0 -20
@@ -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 };