Commit ee54a093 by 姜雷

修改打包方式

parent 70f859f6
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"author": "kuangshu <252019869@qq.com>", "author": "kuangshu <252019869@qq.com>",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vue-cli-service serve ./src/develop.js --port 8891", "dev": "vue-cli-service serve --port 8891",
"dev:local": "vue-cli-service serve ./src/dev-local/develop.js --port 8891",
"start": "npm run dev", "start": "npm run dev",
"lint": "eslint --ext .js,.vue src", "lint": "eslint --ext .js,.vue src",
"build": "vue-cli-service build --modern", "build": "vue-cli-service build --modern",
......
...@@ -9,10 +9,6 @@ ...@@ -9,10 +9,6 @@
<script src="https://cdn.jsdelivr.net/npm/vuex@3.1.0/dist/vuex.js"></script> <script src="https://cdn.jsdelivr.net/npm/vuex@3.1.0/dist/vuex.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.1/dist/vue-router.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.umd.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.umd.js"></script>
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.css"
/>
<script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/customerManage/lib/customerManage.umd.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/baseManage/lib/baseManage.umd.js"></script>
<script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.js"></script> <script src="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.umd.js"></script>
...@@ -28,6 +24,10 @@ ...@@ -28,6 +24,10 @@
rel="stylesheet" rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.css" href="<%= VUE_APP_LIB_MANAGER %>/systemManage/lib/systemManage.css"
/> />
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_MANAGER %><%= VUE_APP_LIB_BASE_URL %>lib/manageShell.css"
/>
<title>系统管理</title> <title>系统管理</title>
</head> </head>
<body> <body>
......
import System from './lib/main'; import System from '../lib/main';
window.manageShell = { default: System }; window.manageShell = { default: System };
......
...@@ -8,7 +8,10 @@ let isLib = (() => { ...@@ -8,7 +8,10 @@ let isLib = (() => {
return false; return false;
} }
})(); })();
console.log(process.env.NODE_ENV == 'development');
let isLocal = (() => {
return /develop/.test(process.argv[3]);
})();
module.exports = { module.exports = {
publicPath: process.env.VUE_APP_BASE_URL, publicPath: process.env.VUE_APP_BASE_URL,
...@@ -23,11 +26,13 @@ module.exports = { ...@@ -23,11 +26,13 @@ module.exports = {
], ],
}, },
chainWebpack: config => { chainWebpack: config => {
config.plugin('html').tap(args => { if (!isLib && isLocal) {
if (process.env.NODE_ENV == 'development') { config.plugin('html').tap(args => {
args[0].template = Path.join('public', 'develop.html'); if (process.env.NODE_ENV == 'development') {
} args[0].template = Path.join('src', 'dev-local', 'develop.html');
return args; }
}); return args;
});
}
}, },
}; };
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