Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from web-infra-dev/rspack-manifest-plugin
Browse files Browse the repository at this point in the history
feat: add rspack-manifest-plugin@5
  • Loading branch information
Boshen authored Dec 5, 2023
2 parents 54bdbe6 + 6e6d439 commit 53e165d
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
13 changes: 13 additions & 0 deletions packages/rspack-manifest-plugin@5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@rspack-compat/rspack-manifest-plugin_4",
"scripts": {
"build": "rspack build"
},
"devDependencies": {
"@rspack/cli": "0.3.11",
"rspack-manifest-plugin": "5.0.0-alpha0"
},
"rspack": {
"version": ">=0.3.11"
}
}
27 changes: 27 additions & 0 deletions packages/rspack-manifest-plugin@5/rspack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { defineConfig } = require('@rspack/cli')
const { WebpackManifestPlugin: RspackManifestPlugin } = require("rspack-manifest-plugin");

module.exports = defineConfig({
plugins: [
new RspackManifestPlugin({
fileName: "rspack-manifest.json",
generate: (seed, files, entries) => {
const manifestFiles = files.reduce((manifest, file) => {
manifest[file.name] = file.path;
return manifest;
}, seed);
const entrypointFiles = Object.keys(entries).reduce(
(previous, name) =>
previous.concat(
entries[name].filter(fileName => !fileName.endsWith(".map"))
),
[]
);
return {
files: manifestFiles,
entrypoints: entrypointFiles
};
}
})
]
});
3 changes: 3 additions & 0 deletions packages/rspack-manifest-plugin@5/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function main() {
return 'hello world'
}
38 changes: 35 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 53e165d

Please sign in to comment.