mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-17 08:25:52 +08:00
新增npmrc以及yarnrc文件,修改config配置变成可配置的cdn加载以及端口设置
This commit is contained in:
@@ -11,8 +11,8 @@ const configs = require('./src/config')
|
||||
* 将开发环境中替换为本地的内容,方便处理bug以及开启vueDev
|
||||
* 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面
|
||||
*/
|
||||
// const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||
const enableProduction = false // 统一取消cdn加载 目前cdn链接的https请求挂了
|
||||
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||
|
||||
|
||||
let externals = {
|
||||
vue: "Vue",
|
||||
@@ -54,8 +54,8 @@ let jsPlugin = [
|
||||
})
|
||||
];
|
||||
// 判断是否需要加载CDN
|
||||
cdn = enableProduction ? cdn : { css: [], js: [] };
|
||||
externals = enableProduction ? externals : {};
|
||||
cdn = enableProduction && configs.enableCDN ? cdn : { css: [], js: [] };
|
||||
externals = enableProduction && configs.enableCDN ? externals : {};
|
||||
jsPlugin = enableProduction ? jsPlugin : [];
|
||||
|
||||
module.exports = {
|
||||
@@ -81,7 +81,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
devServer: {
|
||||
port: 10000
|
||||
port: configs.port
|
||||
},
|
||||
|
||||
// 打包时不生成.map文件 避免看到源码
|
||||
|
||||
Reference in New Issue
Block a user