代码拉取完成,页面将自动刷新
let proxyObj = {}
proxyObj['/'] = {
ws: false,
//target:'http://yifei.free.idcfengye.com',
target: 'http://localhost:8989',
//启用代理
changeOrigin: true,
pathRewrite: {
'^/api': '/'
}
}
const path = require('path')
const webpack = require('webpack')
const resolve = dir => path.join(__dirname, dir)
module.exports = {
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
' window.Quill': 'quill/dist/quill.js',
'Quill': 'quill/dist/quill.js'
})
]
},
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
//设置是否在开发环境下每次保存代码时都启用 eslint验证。
lintOnSave: false,
devServer: {
//允许非本地,内网,连接
disableHostCheck: true,
port: 8080,
proxy: proxyObj
},
chainWebpack: config => {
//quill富文本图片大小编辑
config.plugin('provide').use(webpack.ProvidePlugin, [{
'window.Quill': 'quill'
}])
//使用svg图标
config.module
.rule('svg')
.exclude.add(resolve('src/assets/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/assets/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。