rspack-manifest-plugin 5.0.3 → 5.2.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/README.md +7 -17
- package/dist/helpers.d.ts +3 -2
- package/dist/helpers.js +4 -4
- package/dist/helpers.js.map +1 -1
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +18 -7
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
[tests]: https://img.shields.io/circleci/project/github/shellscape/webpack-manifest-plugin.svg
|
|
2
|
-
[tests-url]: https://circleci.com/gh/shellscape/webpack-manifest-plugin
|
|
3
|
-
[cover]: https://codecov.io/gh/shellscape/webpack-manifest-plugin/branch/master/graph/badge.svg
|
|
4
|
-
[cover-url]: https://codecov.io/gh/shellscape/webpack-manifest-plugin
|
|
5
|
-
[size]: https://packagephobia.now.sh/badge?p=webpack-manifest-plugin
|
|
6
|
-
[size-url]: https://packagephobia.now.sh/result?p=webpack-manifest-plugin
|
|
7
|
-
|
|
8
|
-
<div align="center">
|
|
9
|
-
<img width="256" src="https://raw.githubusercontent.com/shellscape/webpack-manifest-plugin/master/assets/manifest.svg?sanitize=true" alt="webpack-manfiest-plugin"><br/><br/>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
[![tests][tests]][tests-url]
|
|
13
|
-
[![cover][cover]][cover-url]
|
|
14
|
-
[![size][size]][size-url]
|
|
15
|
-
[](https://liberamanifesto.com)
|
|
16
|
-
|
|
17
1
|
# rspack-manifest-plugin
|
|
18
2
|
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://www.npmjs.com/package/rspack-manifest-plugin?activeTab=readme"><img src="https://img.shields.io/npm/v/rspack-manifest-plugin?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a>
|
|
5
|
+
<a href="https://npmcharts.com/compare/rspack-manifest-plugin?minimal=true"><img src="https://img.shields.io/npm/dm/rspack-manifest-plugin.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
|
|
6
|
+
<a href="https://github.com/web-infra-dev/rspack/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" /></a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
19
9
|
A Rspack plugin for generating an asset manifest.
|
|
20
10
|
|
|
21
11
|
:heart: Please consider [Sponsoring shellscape (author of webpack-manifest-plugin)](https://github.com/sponsors/shellscape)
|
|
@@ -124,7 +114,7 @@ Allows filtering the files which make up the manifest. The passed function shoul
|
|
|
124
114
|
Type: `Function`<br>
|
|
125
115
|
Default: `undefined`
|
|
126
116
|
|
|
127
|
-
A custom `Function` to create the manifest. The passed function should match the signature of `(seed: Object, files: FileDescriptor[], entries: string[]) => Object` and can return anything as long as it's serialisable by `JSON.stringify`.
|
|
117
|
+
A custom `Function` to create the manifest. The passed function should match the signature of `(seed: Object, files: FileDescriptor[], entries: string[], context: { compilation: Compilation }) => Object` and can return anything as long as it's serialisable by `JSON.stringify`.
|
|
128
118
|
|
|
129
119
|
### `map`
|
|
130
120
|
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssetInfo, Chunk, Asset, Compilation } from '@rspack/core';
|
|
2
|
-
import { InternalOptions, Manifest } from './';
|
|
1
|
+
import type { AssetInfo, Chunk, Asset, Compilation } from '@rspack/core';
|
|
2
|
+
import type { InternalOptions, Manifest } from './';
|
|
3
3
|
export interface FileDescriptor {
|
|
4
4
|
chunk?: Chunk;
|
|
5
5
|
isAsset: boolean;
|
|
@@ -8,6 +8,7 @@ export interface FileDescriptor {
|
|
|
8
8
|
isModuleAsset: boolean;
|
|
9
9
|
name: string;
|
|
10
10
|
path: string;
|
|
11
|
+
integrity?: string;
|
|
11
12
|
}
|
|
12
13
|
export interface CompilationAssetInfo extends AssetInfo {
|
|
13
14
|
sourceFilename: string;
|
package/dist/helpers.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const generateManifest = (compilation, files, { generate, seed = {} }) => {
|
|
6
6
|
let result;
|
|
7
7
|
if (generate) {
|
|
8
8
|
const entrypointsArray = Array.from(compilation.entrypoints.entries());
|
|
9
9
|
const entrypoints = entrypointsArray.reduce((e, [name, entrypoint]) => Object.assign(e, { [name]: entrypoint.getFiles() }), {});
|
|
10
|
-
result = generate(seed, files, entrypoints);
|
|
10
|
+
result = generate(seed, files, entrypoints, { compilation });
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
13
|
result = files.reduce((manifest, file) => Object.assign(manifest, { [file.name]: file.path }), seed);
|
|
@@ -27,7 +27,7 @@ const reduceAssets = (files, asset, moduleAssets) => {
|
|
|
27
27
|
name = moduleAssets[asset.name];
|
|
28
28
|
}
|
|
29
29
|
else if (asset.info.sourceFilename) {
|
|
30
|
-
name = (0,
|
|
30
|
+
name = (0, node_path_1.join)((0, node_path_1.dirname)(asset.name), (0, node_path_1.basename)(asset.info.sourceFilename));
|
|
31
31
|
}
|
|
32
32
|
if (name) {
|
|
33
33
|
return files.concat({
|
|
@@ -60,7 +60,7 @@ const reduceChunk = (files, chunk, options, auxiliaryFiles) => {
|
|
|
60
60
|
isChunk: false,
|
|
61
61
|
isInitial: false,
|
|
62
62
|
isModuleAsset: true,
|
|
63
|
-
name: (0,
|
|
63
|
+
name: (0, node_path_1.basename)(auxiliaryFile),
|
|
64
64
|
path: auxiliaryFile
|
|
65
65
|
};
|
|
66
66
|
});
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AA2BpD,MAAM,gBAAgB,GAAG,CACvB,WAAwB,EACxB,KAAuB,EACvB,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,EAAmB,EACxC,EAAE;IACF,IAAI,MAAgB,CAAC;IACrB,IAAI,QAAQ,EAAE;QACZ,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CACzC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,EAC9E,EAAyB,CAC1B,CAAC;QACF,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;KAC9D;SAAM;QACL,MAAM,GAAG,KAAK,CAAC,MAAM,CACnB,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EACvE,IAAI,CACL,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA6GO,4CAAgB;AA3GzB,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE,mBAAmB,EAAmB,EAAE,EAAE;IACjF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC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E,KAAK,CAAC,CAAC;AACZ,CAAC,CAAC;AAqBuC,kCAAW;AAnBpD,MAAM,oBAAoB,GAAG,CAAC,IAAoB,EAAE,EAAE;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5C,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAuB,EAAE,OAAwB,EAAE,EAAE,CAC3E,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC;KACtB,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAE3C,MAAM,CAGL,CAAC,IAAI,EAAE,KAAa,EAAE,EAAE,CAAE,IAA4C,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAC7F,KAAK,CACN;KACA,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAEuB,wCAAc"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Compiler, Module, Compilation } from '@rspack/core';
|
|
2
|
-
import { EmitCountMap, InternalOptions } from './';
|
|
1
|
+
import type { Compiler, Module, Compilation } from '@rspack/core';
|
|
2
|
+
import type { EmitCountMap, InternalOptions } from './';
|
|
3
3
|
interface BeforeRunHookArgs {
|
|
4
4
|
emitCountMap: EmitCountMap;
|
|
5
5
|
manifestFileName: string;
|
package/dist/hooks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalModuleLoaderHook = exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const lite_tapable_1 = require("@rspack/lite-tapable");
|
|
7
7
|
const helpers_1 = require("./helpers");
|
|
8
8
|
const compilerHookMap = new WeakMap();
|
|
@@ -27,6 +27,7 @@ const beforeRunHook = ({ emitCountMap, manifestFileName }, _, callback) => {
|
|
|
27
27
|
};
|
|
28
28
|
exports.beforeRunHook = beforeRunHook;
|
|
29
29
|
const emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manifestFileName, moduleAssets, options }, compilation) {
|
|
30
|
+
var _a;
|
|
30
31
|
const emitCount = emitCountMap.get(manifestFileName) - 1;
|
|
31
32
|
const stats = compilation.getStats().toJson({
|
|
32
33
|
all: false,
|
|
@@ -35,7 +36,8 @@ const emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manife
|
|
|
35
36
|
ids: true,
|
|
36
37
|
publicPath: true
|
|
37
38
|
});
|
|
38
|
-
const
|
|
39
|
+
const resolvedPublicPath = options.publicPath !== null ? options.publicPath : stats.publicPath;
|
|
40
|
+
const publicPath = resolvedPublicPath === 'auto' ? '' : resolvedPublicPath;
|
|
39
41
|
const { basePath, removeKeyHash } = options;
|
|
40
42
|
emitCountMap.set(manifestFileName, emitCount);
|
|
41
43
|
const auxiliaryFiles = {};
|
|
@@ -44,7 +46,7 @@ const emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manife
|
|
|
44
46
|
files = files.filter(({ name, path }) => {
|
|
45
47
|
var _a;
|
|
46
48
|
return !path.includes('hot-update') &&
|
|
47
|
-
typeof emitCountMap.get((0,
|
|
49
|
+
typeof emitCountMap.get((0, node_path_1.join)(((_a = compiler.options.output) === null || _a === void 0 ? void 0 : _a.path) || '<unknown>', name)) ===
|
|
48
50
|
'undefined';
|
|
49
51
|
});
|
|
50
52
|
files.forEach((file) => {
|
|
@@ -53,6 +55,12 @@ const emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manife
|
|
|
53
55
|
Object.keys(auxiliaryFiles).forEach((auxiliaryFile) => {
|
|
54
56
|
files = files.concat(auxiliaryFiles[auxiliaryFile]);
|
|
55
57
|
});
|
|
58
|
+
const integrityMap = {};
|
|
59
|
+
(_a = stats.assets) === null || _a === void 0 ? void 0 : _a.forEach((asset) => {
|
|
60
|
+
if (asset.integrity) {
|
|
61
|
+
integrityMap[asset.name] = asset.integrity;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
56
64
|
files = files.map((file) => {
|
|
57
65
|
const normalizePath = (path) => {
|
|
58
66
|
if (!path.endsWith('/')) {
|
|
@@ -64,6 +72,9 @@ const emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manife
|
|
|
64
72
|
name: basePath ? normalizePath(basePath) + file.name : file.name,
|
|
65
73
|
path: publicPath ? normalizePath(publicPath) + file.path : file.path
|
|
66
74
|
};
|
|
75
|
+
if (integrityMap[file.path]) {
|
|
76
|
+
changes.integrity = integrityMap[file.path];
|
|
77
|
+
}
|
|
67
78
|
changes.name = removeKeyHash ? changes.name.replace(removeKeyHash, '') : changes.name;
|
|
68
79
|
return Object.assign(file, changes);
|
|
69
80
|
});
|
|
@@ -75,8 +86,8 @@ const emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manife
|
|
|
75
86
|
const output = options.serialize(manifest);
|
|
76
87
|
compilation.emitAsset(manifestAssetId, new compiler.webpack.sources.RawSource(output));
|
|
77
88
|
if (options.writeToFileEmit) {
|
|
78
|
-
(0,
|
|
79
|
-
(0,
|
|
89
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(manifestFileName), { recursive: true });
|
|
90
|
+
(0, node_fs_1.writeFileSync)(manifestFileName, output);
|
|
80
91
|
}
|
|
81
92
|
}
|
|
82
93
|
getCompilerHooks(compiler).afterEmit.call(manifest);
|
|
@@ -87,7 +98,7 @@ const normalModuleLoaderHook = ({ moduleAssets }, context, module) => {
|
|
|
87
98
|
const { emitFile } = loaderContext;
|
|
88
99
|
loaderContext.emitFile = (file, content, sourceMap) => {
|
|
89
100
|
if (module.userRequest && !moduleAssets[file]) {
|
|
90
|
-
Object.assign(moduleAssets, { [file]: (0,
|
|
101
|
+
Object.assign(moduleAssets, { [file]: (0, node_path_1.join)((0, node_path_1.dirname)(file), (0, node_path_1.basename)(module.userRequest)) });
|
|
91
102
|
}
|
|
92
103
|
return emitFile.call(module, file, content, sourceMap);
|
|
93
104
|
};
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAoD;AACpD,uDAAyD;AAIzD,uCAOmB;AAoBnB,MAAM,eAAe,GAAG,IAAI,OAAO,EAAE,CAAC;AAEtC,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAAE,EAAE;IAC9C,IAAI,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAChC,KAAK,GAAG;YACN,SAAS,EAAE,IAAI,gCAAiB,CAAC,CAAC,UAAU,CAAC,CAAC;YAC9C,UAAU,EAAE,IAAI,gCAAiB,CAAC,CAAC,UAAU,CAAC,CAAC;SAChD,CAAC;QACF,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;KACtC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA+JgC,4CAAgB;AA7JlD,MAAM,aAAa,GAAG,CACpB,EAAE,YAAY,EAAE,gBAAgB,EAAqB,EACrD,CAAW,EACX,QAAkB,EAClB,EAAE;IACF,MAAM,SAAS,GAAG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
|
+
import type { Compiler, RspackPluginInstance, Compilation } from '@rspack/core';
|
|
2
2
|
import { FileDescriptor } from './helpers';
|
|
3
3
|
import { getCompilerHooks } from './hooks';
|
|
4
4
|
export type { FileDescriptor };
|
|
@@ -9,7 +9,9 @@ export interface InternalOptions {
|
|
|
9
9
|
basePath: string;
|
|
10
10
|
fileName: string;
|
|
11
11
|
filter: (file: FileDescriptor) => boolean;
|
|
12
|
-
generate: (seed: Record<any, any>, files: FileDescriptor[], entries: Record<string, string[]
|
|
12
|
+
generate: (seed: Record<any, any>, files: FileDescriptor[], entries: Record<string, string[]>, context: {
|
|
13
|
+
compilation: Compilation;
|
|
14
|
+
}) => Manifest;
|
|
13
15
|
map: (file: FileDescriptor) => FileDescriptor;
|
|
14
16
|
publicPath: string;
|
|
15
17
|
removeKeyHash: RegExp | false;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RspackManifestPlugin = exports.WebpackManifestPlugin = exports.getCompilerHooks = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const hooks_1 = require("./hooks");
|
|
6
6
|
Object.defineProperty(exports, "getCompilerHooks", { enumerable: true, get: function () { return hooks_1.getCompilerHooks; } });
|
|
7
7
|
const emitCountMap = new Map();
|
|
@@ -31,8 +31,8 @@ class WebpackManifestPlugin {
|
|
|
31
31
|
apply(compiler) {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
const moduleAssets = {};
|
|
34
|
-
const manifestFileName = (0,
|
|
35
|
-
const manifestAssetId = (0,
|
|
34
|
+
const manifestFileName = (0, node_path_1.resolve)(((_a = compiler.options.output) === null || _a === void 0 ? void 0 : _a.path) || './', this.options.fileName);
|
|
35
|
+
const manifestAssetId = (0, node_path_1.relative)(((_b = compiler.options.output) === null || _b === void 0 ? void 0 : _b.path) || './', manifestFileName);
|
|
36
36
|
const beforeRun = hooks_1.beforeRunHook.bind(this, { emitCountMap, manifestFileName });
|
|
37
37
|
const emit = hooks_1.emitHook.bind(this, {
|
|
38
38
|
compiler,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAI9C,mCAAoE;AA8G3D,iGA9GyB,wBAAgB,OA8GzB;AA5GzB,MAAM,YAAY,GAAiB,IAAI,GAAG,EAAE,CAAC;AAgC7C,MAAM,QAAQ,GAAG;IACf,cAAc,EAAE,QAAQ;IACxB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK,CAAC;IAChB,GAAG,EAAE,IAAI;IACT,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,wBAAwB;IAEvC,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,CAAC,QAAa;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,EAAE,IAAI;IACV,mBAAmB,EAAE,aAAa;IAClC,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,KAAK;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAQF,MAAM,qBAAqB;IAEzB,YAAY,IAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,QAAkB;;QAEtB,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,MAAM,gBAAgB,GAAG,IAAA,mBAAO,EAAC,CAAA,MAAA,QAAQ,CAAC,OAAO,CAAC,MAAM,0C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AA,oBAAoB,GAAG,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspack-manifest-plugin",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "A Rspack Plugin for generating Asset Manifests",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "rspack-contrib/rspack-manifest-plugin",
|
|
@@ -8,9 +8,6 @@
|
|
|
8
8
|
"homepage": "https://github.com/rspack-contrib/rspack-manifest-plugin",
|
|
9
9
|
"bugs": "https://github.com/rspack-contrib/rspack-manifest-plugin/issues",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=14"
|
|
13
|
-
},
|
|
14
11
|
"scripts": {
|
|
15
12
|
"build": "tsc --project tsconfig.json",
|
|
16
13
|
"ci:coverage": "nyc pnpm ci:test && nyc report --reporter=text-lcov > coverage.lcov",
|
|
@@ -25,7 +22,8 @@
|
|
|
25
22
|
"prepublishOnly": "pnpm lint && pnpm build",
|
|
26
23
|
"pretest": "pnpm install && pnpm build",
|
|
27
24
|
"security": "pnpm audit --audit-level=high --prod",
|
|
28
|
-
"test": "ava --timeout=2m"
|
|
25
|
+
"test": "ava --timeout=2m",
|
|
26
|
+
"bump": "npx bumpp"
|
|
29
27
|
},
|
|
30
28
|
"files": [
|
|
31
29
|
"dist",
|