7f539609 by simon

默认提交

1 parent 916b069a
1 NODE_ENV = 'production'
2 VUE_APP_TITLE = 'fev'
1 NODE_ENV = 'production' 1 NODE_ENV = 'production'
2 VUE_APP_TITLE = 'production'
...\ No newline at end of file ...\ No newline at end of file
2 VUE_APP_TITLE = 'sandbox'
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
2 node_modules 2 node_modules
3 /dist 3 /dist
4 /fev 4 /fev
5 /sandbox
5 6
6 # local env files 7 # local env files
7 .env.local 8 .env.local
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 "serve": "vue-cli-service serve", 6 "serve": "vue-cli-service serve",
7 "dev": "vue-cli-service serve", 7 "dev": "vue-cli-service serve",
8 "build": "vue-cli-service build --no clean", 8 "build": "vue-cli-service build --no clean",
9 "fev": "vue-cli-service build --mode fev", 9 "sandbox": "vue-cli-service build --mode sandbox",
10 "lint": "vue-cli-service lint", 10 "lint": "vue-cli-service lint",
11 "oss": "node build/oss-released.js" 11 "oss": "node build/oss-released.js"
12 }, 12 },
......
...@@ -15,10 +15,11 @@ let plugins = [ ...@@ -15,10 +15,11 @@ let plugins = [
15 15
16 if (process.env.NODE_ENV === 'production') { 16 if (process.env.NODE_ENV === 'production') {
17 // 生产环境 17 // 生产环境
18 webpack_public_path = process.env.VUE_APP_TITLE 18 webpack_public_path = process.env.VUE_APP_TITLE;
19
19 plugins.push( 20 plugins.push(
20 new PrerenderSPAPlugin({ 21 new PrerenderSPAPlugin({
21 staticDir: path.join(__dirname, 'dist'), 22 staticDir: path.join(__dirname, webpack_public_path || 'dist'), // 如果没配置环境目录(生产),则写到目录dist
22 routes: ['/', '/demo', '/about'], 23 routes: ['/', '/demo', '/about'],
23 renderer: new Renderer({ 24 renderer: new Renderer({
24 inject: { 25 inject: {
......