You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
const path = require('path'); |
|
const { name } = require('./package'); |
|
const resolve = (dir) => path.join(__dirname, dir) |
|
const DEV_PORT = 7102 |
|
const OUTPUT_DIR = 'docker/dist' |
|
|
|
module.exports = { |
|
assetsDir: 'static', |
|
outputDir: OUTPUT_DIR, |
|
chainWebpack: config => { |
|
config.resolve.alias.set('@', resolve('src')) |
|
config.resolve.alias.set('@components', resolve('src/components')) |
|
config.resolve.alias.set('@utils', resolve('src/utils')) |
|
config.output |
|
.library(`${name}-[name]`) |
|
.libraryTarget('umd') |
|
.jsonpFunction(`webpackJsonp_${name}`) |
|
// 指定pinia.cjs采用es导入导出,避免出现采用CommonJS的模式导出导致浏览器不支持 |
|
config.module.rule('pinia-mjs-loader') |
|
.test(/\.mjs$/) |
|
.include |
|
.add(/node_modules/) |
|
.end() |
|
// 将.mjs文件当作普通JavaScript模块处理 |
|
.type('javascript/auto') |
|
}, |
|
devServer: { |
|
host: '0.0.0.0', |
|
port: DEV_PORT, |
|
open: false, |
|
disableHostCheck: true, |
|
headers: { |
|
'Access-Control-Allow-Origin': '*', |
|
}, |
|
proxy: { |
|
[process.env.VUE_APP_BASE_API]: { |
|
target: `http://192.168.3.10:9999`, |
|
pathRewrite: { |
|
['^' + process.env.VUE_APP_BASE_API]: '' |
|
} |
|
} |
|
}, |
|
} |
|
}
|
|
|