代码拉取完成,页面将自动刷新
同步操作将从 ELCube/ELCube Front 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CompressionWebpackPlugin = require('compression-webpack-plugin');
const fs = require('fs');
const packageInfo = require("./package.json");
const version = packageInfo.version;
const dependencies = packageInfo.dependencies;
fs.writeFileSync(__dirname + '/src/apps/version.json',JSON.stringify({version,dependencies}));
module.exports = {
"pages": {
"index": {
"entry": process.env.ENTRY_INDEX||'./src/main.js',
}
},
"runtimeCompiler":false,
"productionSourceMap":false,
"css":{
//extract: false,
"loaderOptions":{
"less":{
"javascriptEnabled":true
}
}
},
"devServer": {
"port": "7200",
"proxy": {
"^/api": {
"target": process.env.DEV_SERVER_PROXY_TARGET,
"ws": true,
"changeOrigin": true,
"pathRewrite":{
"^/api": process.env.DEV_SERVER_PROXY_PATH
}
},
"^/bpm": {
"target": process.env.DEV_SERVER_PROXY_TARGET,
"ws": true,
"changeOrigin": true
}
},
"overlay": {
"warnings": true,
"errors": true
}
},
chainWebpack: config => {
config.module
.rule('md')
.test(/\.md$/)
.use('vue-loader')
.loader('vue-loader')
.end()
.use('vue-markdown-loader')
.loader('vue-markdown-loader/lib/markdown-compiler')
.tap(() => {
return {
raw: true
}
})
.end()
config.module
.rule("i18n")
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use("i18n")
.loader("@kazupon/vue-i18n-loader")
.end();
config.module
.rule("docs")
.resourceQuery(/blockType=docs/)
.type('javascript/auto')
.use("docs")
.loader("./src/utils/docs-loader.js")
.end();
},
configureWebpack: (config)=>{
config.plugins.push(
new CopyWebpackPlugin({
patterns:[
{
flatten:true,
from: __dirname.replace(/[\\]/g,'/')+'/src/apps/less/*.less',
to: __dirname+'/dist/less/'
},
{
flatten:true,
from: __dirname.replace(/[\\]/g,'/')+'/src/apps/*.((le)|(sc))ss',
to: __dirname+'/dist/'
},
]
})
);
if(config.mode === 'production'){
if(process.env.EXTERNALS!=='false'){
let externals = {}
fs.readdirSync(__dirname + '/node_modules').forEach(function(item) { // 我没有使用es6
if(item.indexOf('.') === 0) return
if(item==='vue-codemirror') return
if(item==='codemirror') return
externals[item] = 'commonjs ' + item
})
config.externals = externals;
config.output.libraryTarget = 'umd';
}
}
if(process.env.npm_lifecycle_event && process.env.npm_lifecycle_event.startsWith('build')){
config.plugins.push(
new CompressionWebpackPlugin({
test: /\.js$|\.html$|\.css/, //匹配文件名
threshold: 10240, //对超过10k的数据进行压缩
deleteOriginalAssets: false //是否删除原文件
})
);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。