MeterSphere/framework/sdk-parent/frontend/vue.config.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-10-10 13:41:39 +08:00
const path = require('path');
const {name} = require('./package');
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
2022-10-10 18:35:38 +08:00
productionSourceMap: false,
2022-10-10 13:41:39 +08:00
devServer: {
port: 3000,
client: {
webSocketTransport: 'sockjs',
},
webSocketServer: 'sockjs',
2022-10-13 12:39:31 +08:00
allowedHosts: 'all',
2022-10-10 13:41:39 +08:00
proxy: {
['^((?!/login)(?!/document))']: {
target: 'http://localhost:8000',
ws: false
},
'/websocket': {
target: 'http://localhost:8000',
ws: true
},
},
},
configureWebpack: {
2022-10-10 18:35:38 +08:00
devtool: 'cheap-module-source-map',
2022-10-10 13:41:39 +08:00
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]'
})
}
};