Copies the manifest.json file generated by vite build
to a specific location.
Vite will generate a manifest file after vite build
, in build.outDir
. There's no configuration to change the destination dir for the generation of the manfest file. Sometimes you need this manifest file in a specific location. You could use this plugin to copy the generated manifest file to the destination location you specified.
npm i vite-plugin-copy-manifest -D
import copyManifest from 'vite-plugin-copy-manifest';
export default {
build: {
manifest: "assets.json",
outDir: "./static/dist/",
},
plugins: [
// specify destDir
// the manifest file `assets.json` will be copied to `./data/`
copyManifest({ destDir: './data/' })
]
}
MIT License © 2023-PRESENT @larryzhao