简体   繁体   中英

How to copy a json file with the webpack copy plugin and include the version from package.json file?

I would like to copy my manifest.json file (for web extensions) into the build/ folder and use the webpack.DefinePlugin to replace the version in the manifest.json file with the version of the package.json file.

How can I do this? (sorry for my bad english!)

I have already tried it with the file loader (based on this question) but it didn't work for me.

Sorry, I do not have enough reputation yet to add a comment, but there is another way to do this – by using the CopyWebpackPlugin instead of the DefinePlugin. See my answer on a related question for an example setup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM