| | |
| | | 'use strict' |
| | | const path = require('path') |
| | | const defaultSettings = require('./src/settings.js') |
| | | |
| | | const webpack = require('webpack') |
| | | function resolve(dir) { |
| | | return path.join(__dirname, dir) |
| | | } |
| | |
| | | outputDir: 'dist', |
| | | assetsDir: 'static', |
| | | lintOnSave: process.env.NODE_ENV === 'development', |
| | | // css: { |
| | | // loaderOptions: { |
| | | // css: {}, |
| | | // postcss: { |
| | | // plugins: [ |
| | | // require('postcss-px2rem')({ |
| | | // remUnit: 192// /设计图宽度/10 |
| | | // }) |
| | | // ] |
| | | // } |
| | | // } |
| | | // }, |
| | | productionSourceMap: false, |
| | | devServer: { |
| | | port: port, |
| | |
| | | pathRewrite: { // 路径重写,替换target中的请求地址 |
| | | ['^' + process.env.VUE_APP_BASE_API]: '/api/' |
| | | } |
| | | // ws: true;//开启ws, 如果是http代理此处可以不用设置 |
| | | } |
| | | } |
| | | // before: require('./mock/mock-server.js') |
| | |
| | | alias: { |
| | | '@': resolve('src') |
| | | } |
| | | } |
| | | }, |
| | | plugins: [ |
| | | new webpack.ProvidePlugin({ |
| | | jQuery: 'jquery', |
| | | $: 'jquery' |
| | | }) |
| | | ] |
| | | }, |
| | | chainWebpack(config) { |
| | | // it can improve the speed of the first screen, it is recommended to turn on preload |