加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
const $utils = require('./utils/build.utils')
const webpack = require('webpack')
console.log('当前环境', process.env.ENV)
console.log('当前模式', process.env.MODE === 'dev' ? '本地调试' : '打包编译')
const collectEnv = ['env', 'mode']
const defined = {
WEBAPP: {
...(collectEnv.reduce((ret, key) => {
ret[key] = JSON.stringify(process.env[key])
return ret
}, {})),
publicPath: '"/plain-ui-web"',
},
}
console.log(defined.WEBAPP.publicPath.replace(/"/g, ''))
module.exports = {
publicPath: defined.WEBAPP.publicPath.replace(/"/g, ''),
outputDir: $utils.resolve('page'),
lintOnSave: false,
devServer: {
port: '7556',
},
pages: {
index: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
title: 'plain-ui document',
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
manager: {
entry: 'manager/main.js',
template: 'public/index.html',
filename: 'manager.html',
title: 'plain manager',
chunks: ['chunk-vendors', 'chunk-common', 'manager']
},
},
configureWebpack: {
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'src': $utils.resolve('src'),
'manager': $utils.resolve('manager'),
}
},
module: {
rules: [
{
test: /.md$/,
loader: 'text-loader'
},
]
},
plugins: [
new webpack.DefinePlugin(defined),
]
},
css: {
loaderOptions: {
sass: {
data: `@import "src/style/global.scss";`
}
}
},
chainWebpack: config => {
config.plugins.delete('prefetch-index')
config.plugins.delete('prefetch-manager')
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化