1 Star 0 Fork 19

0OoSEAoO0/vue-data-view

forked from 轻云吻雪/vue-data-view 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 2.54 KB
一键复制 编辑 原始数据 按行查看 历史
lizhensheng 提交于 2020-04-02 13:54 . fixed bugs
let fs =require('fs')
let path =require('path')
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const MonacoEditorPlugin = require('monaco-editor-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
function resolve(name){
return __dirname + '/' + name
}
module.exports = {
assetsDir:"static",
pages:{
index:{
entry:'client/main.js',
template:'public/engine-h5-long.html',
filename:'index.html'
}
},
devServer: {
proxy: {
'/': {
target: 'http://localhost:4000',
ws: false,
changeOrigin: true,
pathRewrite:{}
}
}
},
css:{
loaderOptions:{
sass:{
data:fs.readFileSync(path.resolve(__dirname,'./client/common/styles/variables.scss'),'utf-8')
}
}
},
productionSourceMap:process.env.NODE_ENV !=='production',
configureWebpack:config=>{
if(process.env.NODE_ENV === 'production'){
config.plugins.push(
new CompressionWebpackPlugin({
filename:'[path].gz[query]',
algorithm:'gzip',
test:new RegExp('\\.('+productionGzipExtensions.join('|')+')$'),
threshold:10240,
minRatio:0.8
})
)
}
else{
}
config.plugins.push(new MonacoEditorPlugin({
// https://github.com/Microsoft/monaco-editor-webpack-plugin#options
// Include a subset of languages support
// Some language extensions like typescript are so huge that may impact build performance
// e.g. Build full languages support with webpack 4.0 takes over 80 seconds
// Languages are loaded on demand at runtime
//'javascript', 'css', 'html', 'typescript',
languages: [ 'json', 'sql', 'javascript']
}))
},
chainWebpack: config=>{
config.resolve.alias
.set('@',path.resolve('client'))
.set('@client',path.resolve('client'))
.set('@plugins',path.resolve('plugins'))
.set('@server',path.resolve('server'))
config.module
.rule('js')
.include.add(/engine-template/).end()
.include.add(/client/).end()
.include.add(/common/).end()
.use('babel')
.loader('babel-loader')
.tap(options=>{
return options
})
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/imsea/vue-data-view.git
git@gitee.com:imsea/vue-data-view.git
imsea
vue-data-view
vue-data-view
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385