1 Star 0 Fork 95

砂之守鹤风影/Scriptis

forked from WeBank/Scriptis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
arbor 提交于 2019-09-16 14:37 . 1.automatic packaging into ZIP packages;
// vue.config.js
let CopyWebpackPlugin = require('copy-webpack-plugin')
let FileManagerPlugin = require('filemanager-webpack-plugin');
let path = require('path')
let fs = require('fs');
const getVersion = () => {
const pkgPath = path.join(__dirname, './package.json');
let pkg = fs.readFileSync(pkgPath);
pkg = JSON.parse(pkg);
return pkg.version;
}
module.exports = {
outputDir: 'dist/dist',
chainWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
config.plugin('compress').use(FileManagerPlugin, [{
onEnd: {
copy: [
{ source: 'node_modules/monaco-editor/dev/vs', destination: `./dist/dist/static/vs` },
{ source: './config.sh', destination: `./dist` },
{ source: './install.sh', destination: `./dist` }
],
// 先删除根目录下的zip包
delete: [`./wedatasphere-scriptis-${getVersion()}-dist.zip`],
// 将dist文件夹下的文件进行打包
archive: [
{ source: './dist', destination: `./wedatasphere-scriptis-${getVersion()}-dist.zip` },
]
},
}])
}
},
configureWebpack: {
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve(__dirname, './src'),
'@js': path.resolve(__dirname, './src/js'),
'@assets': path.resolve(__dirname, './src/assets')
}
},
plugins: [
new CopyWebpackPlugin([{
from: 'node_modules/monaco-editor/dev/vs',
to: 'static/vs',
}]),
]
},
// 选项...
pluginOptions: {
mock: {
entry: 'mock.js',
power: false
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/szshfy/Scriptis.git
git@gitee.com:szshfy/Scriptis.git
szshfy
Scriptis
Scriptis
master

搜索帮助