zip-webpack-plugin icon indicating copy to clipboard operation
zip-webpack-plugin copied to clipboard

manifest.json is not included

Open duongtdvn opened this issue 7 years ago • 9 comments

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!

duongtdvn avatar Dec 04 '18 14:12 duongtdvn

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.

wingleung avatar Dec 12 '18 09:12 wingleung

+1

jhlee8804 avatar Oct 31 '19 02:10 jhlee8804

+1

gusevda avatar Jul 16 '20 17:07 gusevda

+1 also looking to include the manifest in my zip

web1100manager avatar Feb 19 '21 18:02 web1100manager

+1 also public folder is ignored, I think the entire build folder should be zipped

vasilevich avatar Apr 20 '21 05:04 vasilevich

+1 any solution?

qiuyaofan avatar Aug 20 '21 02:08 qiuyaofan

+1 ping @erikdesjardins

tarampampam avatar Oct 16 '21 17:10 tarampampam

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')
            },
          ],
        },
      },
    })
  ],

  // ...
}

tarampampam avatar Oct 22 '21 05:10 tarampampam

Non webpack alternative. Very simple... https://www.npmjs.com/package/zip-build

DragonAxe01 avatar Jan 15 '22 19:01 DragonAxe01