const webpack = require('webpack') const path = require('path') function resolve (dir) { return path.join(__dirname, dir) } module.exports = { // publicPath: '/mi', outputDir: 'dist', // 运行时生成的生产环境构建文件的目录(默认''dist'',构建之前会被清除) assetsDir: 'static', // 放置生成的静态资源(s、css、img、fonts)的(相对于 outputDir 的)目录(默认'') // 过滤掉打包会报错的插件依赖 transpileDependencies: ['vue-echarts', 'resize-detector', 'resize-detector', 'vue-quill-editor', 'quill-image-drop-module'], devServer: { port: 8080, proxy: { // 配置跨域 '/api': { //10.0.10.173 //10.0.10.97 target: 'http://localhost:7060', // 服务器 changeOrigin: true }, // 请求静态图片配置项 '/api/home/pic': { target: 'http://10.94.1.164:7060', // 图片请求的nginx网址 changeOrigin: true } } }, chainWebpack: config => { config.module .rule('svg') .exclude.add(resolve('src/icon')) .end() config.module .rule('icons') .test(/\.svg$/) .include.add(resolve('src/icon')) .end() .use('svg-sprite-loader') .loader('svg-sprite-loader') .options({ symbolId: 'icon-[name]' }) .end() config.plugin('html').tap(args => { args[0].title = '大众' return args }) }, configureWebpack: { // provide the app's title in webpack's name field, so that // it can be accessed in index.html to inject the correct title. // externals: { // 'AMap': 'AMap' // 高德地图配置 // }, // name: name, // devtool: 'source-map', // resolve: { // alias: { // '@': resolve('src') // } // }, plugins: [ new webpack.ProvidePlugin({ 'window.Quill': 'quill/dist/quill.js', Quill: 'quill/dist/quill.js' // Enumerable: "linq" }) ] }, }