forked from OXOYO/X-Flowchart-Vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NODE_ENV = 'build-lib' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NODE_ENV = 'development' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NODE_ENV = 'production' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ | |
* 文档:https://cli.vuejs.org/zh/config/ | ||
*/ | ||
|
||
const webpack = require('webpack') | ||
|
||
module.exports = { | ||
// 部署应用包时的基本URL,置空使用相对路径 | ||
publicPath: '/X-Flowchart-Vue/', | ||
|
@@ -48,25 +46,25 @@ module.exports = { | |
'@antv/g6': 'G6', | ||
'iview': 'iview' | ||
} | ||
} | ||
, | ||
}, | ||
chainWebpack: config => { | ||
const cdn = { | ||
// 访问https://unpkg.com/element-ui/lib/theme-chalk/index.css获取最新版本 | ||
css: ['//unpkg.com/[email protected]/dist/styles/iview.css'], | ||
js: [ | ||
'//unpkg.com/[email protected]/dist/vue.min.js', | ||
'//unpkg.com/[email protected]/dist/vuex.min.js', | ||
'//unpkg.com/[email protected]/dist/iview.js', | ||
'//unpkg.com/@antv/[email protected]/dist/g6.min.js' | ||
] | ||
} | ||
config.when(['development', 'production'].includes(process.env.NODE_ENV), config => { | ||
const cdn = { | ||
css: ['//unpkg.com/[email protected]/dist/styles/iview.css'], | ||
js: [ | ||
'//unpkg.com/[email protected]/dist/vue.min.js', | ||
'//unpkg.com/[email protected]/dist/vuex.min.js', | ||
'//unpkg.com/[email protected]/dist/iview.js', | ||
'//unpkg.com/@antv/[email protected]/dist/g6.min.js' | ||
] | ||
} | ||
|
||
// 如果使用多页面打包,使用vue inspect --plugins查看html是否在结果数组中 | ||
config.plugin('html').tap(args => { | ||
// html中添加cdn | ||
args[0].cdn = cdn | ||
return args | ||
// 如果使用多页面打包,使用vue inspect --plugins查看html是否在结果数组中 | ||
config.plugin('html').tap(args => { | ||
// html中添加cdn | ||
args[0].cdn = cdn | ||
return args | ||
}) | ||
}) | ||
} | ||
} |