61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
// 分析器配置,生产环境禁用
|
||
|
||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||
|
||
const analyzerConfig = process.env.ANALYZ === "ON" ? {
|
||
// analyzerMode: 'server',
|
||
// analyzerHost: '127.0.0.1',
|
||
// analyzerPort: '8888',
|
||
// defaultSizes: 'parsed',
|
||
analyzerMode: 'static',
|
||
reportFilename: 'report.html',
|
||
openAnalyzer: true,
|
||
generateStatsFile: true,
|
||
statsFilename: 'stats.json',
|
||
} : {
|
||
analyzerMode: 'disabled',
|
||
generateStatsFile: false,
|
||
}
|
||
|
||
|
||
module.exports = {
|
||
lintOnSave: false,
|
||
publicPath: '/', // 服务器url路径
|
||
outputDir: 'dist',
|
||
devServer: {
|
||
port: 8088, // 本地启动端口
|
||
proxy: 'http://118.31.189.121:8181', // 集成环境api地址
|
||
// proxy: 'http://112.124.33.151:8181', // 开发环境api地址
|
||
// proxy: 'http://192.168.1.92:8181', // 本地开发环境
|
||
// proxy: 'http://localhost:8181', // 本地开发环境
|
||
// proxy: 'https://manager-pre.hztiejian.com'
|
||
},
|
||
configureWebpack: {
|
||
// 不打包以下组件,通过外部cdn引入
|
||
externals: {
|
||
"vue": "Vue",
|
||
"moment": "moment",
|
||
"element-ui": "ELEMENT",
|
||
'ant-design-vue': 'antd',
|
||
'echarts': 'echarts',
|
||
},
|
||
plugins: [
|
||
new BundleAnalyzerPlugin(analyzerConfig)
|
||
]
|
||
},
|
||
pages:{
|
||
index:{
|
||
entry:'./src/main.js',
|
||
template: 'public/index.html'
|
||
},
|
||
face:{
|
||
entry:'./src/extra/face.js',
|
||
template: 'public/extra/face.html'
|
||
},
|
||
kuaishouauth:{
|
||
entry:'./src/extra/kuaishouauth.js',
|
||
template: 'public/index.html'
|
||
}
|
||
}
|
||
}
|