123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- const path = require('path')
- const webPackConfig = require('./webpack.config');
- function resolve(dir) {
- // console.log(dir);
- return path.join(__dirname, dir);
- }
- const baseUrl = "https://127.0.0.1:19200"
- // const baseUrl = "https://hofuniot.cn:29072"
- // const c =
- module.exports = {
- devServer: {
- port: 8080,
- https: true,
- proxy: {
- '/api/': {
- target: baseUrl,
- ws: true,
- changeOrigin: true,
- },
- '/debug': {
- target: baseUrl,
- ws: true,
- changeOrigin: true,
- pathRewrite: {
- '^/debug': '/'
- }
- },
- '/ai': {
- target: baseUrl,
- secure: false,
- changeOrigin: true,
- },
- '/aiLib': {
- target: baseUrl,
- secure: false,
- changeOrigin: true,
- },
- '/mFile': {
- target: baseUrl,
- secure: false,
- changeOrigin: true,
- },
- '/static/snap': {
- target: baseUrl,
- secure: false,
- changeOrigin: true,
- },
- },
- },
- outputDir: '../src/main/resources/static/', // 输出文件目录
- // publicPath: '', // 项目部署的基本路径
- pages: {
- index: {
- entry: 'src/pages/index/main.js',
- template: 'src/pages/index/index.html',
- filename: 'index.html'
- },
- share: {
- entry: 'src/pages/sharePlay/shareMain.js',
- template: 'src/pages/sharePlay/index.html',
- filename: 'share.html'
- },
- account: {
- entry: 'src/pages/account/main.js',
- template: 'src/pages/account/index.html',
- filename: 'account.html'
- }
- },
- configureWebpack: webPackConfig,
- css: {
- loaderOptions: {
- sass: {
- additionalData:`@import "./src/assets/scss/style.scss";`
- }
- }
- },
- lintOnSave: false,
- chainWebpack: config => {
- config.plugin('define').tap(args=>{
- const argv = process.argv
- const icourt = argv[argv.indexOf('--icourt-mode') + 1]
- args[0]['process.env'].MODE = `"${icourt}"`
- return args
- })
- const svgRule = config.module.rule('svg')
- svgRule.uses.clear()
- svgRule.exclude.add(/noe_modules/)
- svgRule
- .test(/\.svg/)
- .use('svg-sprite-loader')
- .loader('svg-sprite-loader')
- .options({
- symbolId: 'icon-[name]'
- })
- const imagesRule = config.module.rule('images')
- imagesRule.exclude.add(resolve('src/icons'))
- config.module
- .rule('images')
- .test(/\.(png|jpe?g|gif|svg)(\?.*)?$/)
- }
- };
|