This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from web-infra-dev/rspack-manifest-plugin
feat: add rspack-manifest-plugin@5
- Loading branch information
Showing
4 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; | ||
} | ||
}) | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function main() { | ||
return 'hello world' | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.