mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 21:49:23 +08:00
57 lines
1.2 KiB
JavaScript
57 lines
1.2 KiB
JavaScript
const path = require('path');
|
|
const {name} = require('./package');
|
|
|
|
function resolve(dir) {
|
|
return path.join(__dirname, dir);
|
|
}
|
|
|
|
module.exports = {
|
|
productionSourceMap: false,
|
|
devServer: {
|
|
port: 3000,
|
|
client: {
|
|
webSocketTransport: 'sockjs',
|
|
},
|
|
webSocketServer: 'sockjs',
|
|
disableHostCheck: true,
|
|
proxy: {
|
|
['^((?!/login)(?!/document))']: {
|
|
target: 'http://localhost:8000',
|
|
ws: false
|
|
},
|
|
'/websocket': {
|
|
target: 'http://localhost:8000',
|
|
ws: true
|
|
},
|
|
},
|
|
},
|
|
configureWebpack: {
|
|
devtool: 'cheap-module-source-map',
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve('src')
|
|
}
|
|
},
|
|
},
|
|
chainWebpack: config => {
|
|
config.devtool('source-map')
|
|
config.resolve.alias.set('@', resolve('./src'))
|
|
config.output.library("MsFrontend")
|
|
|
|
config.module
|
|
.rule('svg')
|
|
.exclude.add(resolve('src/assets/module'))
|
|
.end()
|
|
config.module
|
|
.rule('icons')
|
|
.test(/\.svg$/)
|
|
.include.add(resolve('src/assets/module'))
|
|
.end()
|
|
.use('svg-sprite-loader')
|
|
.loader('svg-sprite-loader')
|
|
.options({
|
|
symbolId: 'icon-[name]'
|
|
})
|
|
}
|
|
};
|