Commit af8a740b by 林家欣

修改打包环境配置

parent 804e1a2c
NODE_ENV = "development"
VUE_APP_CURRENTMODE = "development" VUE_APP_CURRENTMODE = "development"
VUE_APP_HOST_URL = "http://81.68.189.225:9091" VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "/" VUE_APP_API_URL = "/"
......
...@@ -8,10 +8,10 @@ module.exports = { ...@@ -8,10 +8,10 @@ module.exports = {
'eslint:recommended' 'eslint:recommended'
], ],
rules: { rules: {
'no-console': process.env.NODE_ENV !== 'development' ? 'error' : 'off', 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV !== 'development' ? 'error' : 'off' 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}, },
parserOptions: { parserOptions: {
parser: 'babel-eslint' parser: 'babel-eslint'
} }
} }
\ No newline at end of file
...@@ -990,7 +990,7 @@ export default { ...@@ -990,7 +990,7 @@ export default {
}, },
getCustomService() { getCustomService() {
let service = localStorage.getItem("gs-custom-service") || ""; let service = localStorage.getItem("gs-custom-service") || "";
console.log("getCustomService-----------", service); // console.log("getCustomService-----------", service);
if (service) { if (service) {
service = JSON.parse(service); service = JSON.parse(service);
this.showCustomService(service); this.showCustomService(service);
...@@ -1097,7 +1097,7 @@ export default { ...@@ -1097,7 +1097,7 @@ export default {
}, },
// 商品全球身份证 // 商品全球身份证
async homeNewGtin() { async homeNewGtin() {
console.log(process.env, "process.env"); console.log(process.env.NODE_ENV, "process.env");
this.$http this.$http
.get(`${process.env.VUE_APP_GDS_URL}/Data/NewGtin`) .get(`${process.env.VUE_APP_GDS_URL}/Data/NewGtin`)
.then((res) => { .then((res) => {
......
...@@ -6,7 +6,7 @@ const resolve = dir => { ...@@ -6,7 +6,7 @@ const resolve = dir => {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
const BASE_URL = process.env.NODE_ENV !== "development" const BASE_URL = process.env.NODE_ENV === "production"
? "/" ? "/"
: "/" : "/"
...@@ -16,7 +16,7 @@ module.exports = { ...@@ -16,7 +16,7 @@ module.exports = {
indexPath: "index.html", //生成的html路径 indexPath: "index.html", //生成的html路径
filenameHashing: true, //生成文件名中包含hash filenameHashing: true, //生成文件名中包含hash
productionSourceMap: false, productionSourceMap: false,
lintOnSave: process.env.NODE_ENV !== "development", // 是否保存时limt代码 lintOnSave: process.env.NODE_ENV === "production", // 是否保存时limt代码
runtimeCompiler: true, //是否使用编译器 runtimeCompiler: true, //是否使用编译器
chainWebpack: config => { chainWebpack: config => {
config.resolve.alias config.resolve.alias
...@@ -25,7 +25,7 @@ module.exports = { ...@@ -25,7 +25,7 @@ module.exports = {
}, },
css: { css: {
modules: false, //启动css Modules modules: false, //启动css Modules
extract: process.env.NODE_ENV !== "development", //css分离插件 extract: process.env.NODE_ENV === "production", //css分离插件
loaderOptions: { loaderOptions: {
css: { css: {
localIdentName: "[path]-[name]-[local]-[hash:base64:5]", localIdentName: "[path]-[name]-[local]-[hash:base64:5]",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment