manifest.json is not included
I am building a chrome extension and use this plugin to zip the released directory. Currently all the content under release directory is zipped except the manifest.json. And the manifest.json is generated using webpack-version-file-plugin like so:
new VersionFilePlugin({
packageFile: path.resolve(__dirname, '../package.json'),
template: path.resolve(__dirname, '../src/manifest.json'),
outputFile: path.resolve(__dirname, '../build/pro/manifest.json')
}),
new ZipPlugin({
filename: `${pkg.name}-${pkg.version}.zip`
})
Could you help me to solve this issue? Thank you!
I'm having the same problem, no JSON files are included in the compilation.assets.
I tried adding json-loader to possibly allow json files in webpack builds... but that doesn't do anything.
It seems the plugin doesn't receive the json file in the first place.
+1
+1
+1 also looking to include the manifest in my zip
+1 also public folder is ignored, I think the entire build folder should be zipped
+1 any solution?
+1 ping @erikdesjardins
An alternative solution:
$ yarn add --dev filemanager-webpack-plugin # https://www.npmjs.com/package/filemanager-webpack-plugin
// webpack.js
const FileManagerPlugin = require('filemanager-webpack-plugin')
module.exports = {
// ...
output: {
path: path.join(__dirname, '..', 'dist', 'js'),
filename: '[name].js',
},
plugins: [
// ...
new FileManagerPlugin({
events: {
onEnd: {
archive: [
{
source: path.join(__dirname, '..', 'dist'),
destination: path.join(__dirname, '..', 'dist.zip')
},
],
},
},
})
],
// ...
}
Non webpack alternative. Very simple... https://www.npmjs.com/package/zip-build