offline-config-webpack-plugin
v1.0.6
Published
offline-config-webpack-plugin ==== 离线包 webpack插件
Downloads
3
Readme
offline-config-webpack-plugin
离线包 webpack插件
安装
npm i --save-dev offline-config-webpack-plugin
//or
yarn add offline-config-webpack-plugin -D
使用
const OfflineConfigWebpackPlugin = require('offline-config-webpack-plugin')
// webpack.config.js
{
...
plugins: [
...,
new OfflineConfigWebpackPlugin([
{
baseUrl: 'html/other/', // 配置打包文件的跟文件夹
exclude: ['.gz'], // 打包排除
zip: 'dist/html/other/healthy.zip', // 压缩包位置
dir: 'h5mpPackage/transactionDetail', //生成存放的目录(此项配置会删除压缩包,直接把需要压缩的文件存放到当前目录)
json: 'jrwebview.json', // 打包的文件列表
map: { // 映射 用于 json文件
'dist/html': 'https://mwallet.cjdfintech.com/html'
},
files: [ // 需要打包的文件列表
'dist/html/other/common.css',
'dist/html/other/common.js',
'dist/html/other/favicon.ico',
'dist/html/other/m404.html',
'dist/html/other/healthy/',
],
conReplace: { // 内容替换
'dist/html/other/healthy/**/*.css': {
'/html/other/healthy/img': '../img'
},
'dist/html/other/healthy/**/*.js': {
'/html/other/healthy/img': '/healthy/img'
}
}
},
{
exclude: ['.gz'],
zip: 'dist/html/other/privilege.zip',
json: 'jrwebview.json',
map: {
'dist/html': 'https://mwallet.cjdfintech.com/html'
},
files: [
'dist/html/other/common.css.gz',
'dist/html/other/common.js.gz',
'dist/html/other/favicon.ico.gz',
'dist/html/other/m404.html.gz',
'dist/html/other/privilege/',
]
}
]),
...
]
...
}