代码拉取完成,页面将自动刷新
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')
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。