webpack zip include
时间: 2023-07-01 21:24:50 浏览: 121
To include files in a zip archive using webpack, you can use the `zip-webpack-plugin`. Here's an example configuration:
```
const ZipPlugin = require('zip-webpack-plugin');
module.exports = {
// ...other webpack config
plugins: [
new ZipPlugin({
filename: 'my-archive.zip',
path: '/my/path/to/archive',
include: [/\.html$/, /\.css$/], // include only html and css files
}),
],
};
```
In this example, we're including only `.html` and `.css` files in the zip archive. You can modify the `include` property to include other types of files.
阅读全文