1 Star 0 Fork 1

shech / ameMobileApp

forked from coboy / ameMobileApp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
coboy 提交于 2021-01-31 22:59 . 认识若只如初见
let path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
};
let IS_PRODUCTION = process.env.NODE_ENV === 'production';
module.exports = {
publicPath: './',
lintOnSave: false,
filenameHashing: false,
pages: {
index: {
// page 的入口
entry: 'src/main.ts',
// 模板来源
template: 'public/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
title: 'AmeAdmin',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk
chunks: ['chunk-vendors', 'chunk-common', 'index']
}
},
productionSourceMap: !IS_PRODUCTION,
configureWebpack: (config) => {
if (IS_PRODUCTION) {
//为生产环境进行配置 如:去除console.log ,debugger
config.optimization.minimizer.map((arg) => {
const option = arg.options.terserOptions.compress;
option.drop_console = true; // 打开开关
return arg;
});
} else {
//为开发环境进行配置
}
},
chainWebpack: config => {
//设置别名 路径优化,但是若要引用static文件夹下文件,则要用一般设置
config.resolve.alias
.set("@", resolve("src"))
.set("@lib", resolve("src/library"))
.set("@store", resolve("src/store"))
.end()
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/library/assets/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/library/assets/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
devServer: {
port: 9527,
// proxy: {
// '/api': {
// target: 'http://192.168.3.139:9100', // 代理接口
// changeOrigin: true,
// pathRewrite:{
// '^/api': ''
// }
// // pathRewrite: {
// // '^/api': '/mock' // 代理的路径
// // }
// }
// },
before: function (app) {
app.use(require('./mock/mockServer.ts'));
},
overlay: {
warning: false,
error: true
}
}
}
JavaScript
1
https://gitee.com/swantb/ame-mobile-app.git
git@gitee.com:swantb/ame-mobile-app.git
swantb
ame-mobile-app
ameMobileApp
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891