Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
521ef793
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
340
Star
18155
Fork
5506
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
521ef793
编写于
12月 25, 2020
作者:
V
volcan0
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 增加自动扫描package.json, 从cdn引入资源
上级
415142e2
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
47 addition
and
9 deletion
+47
-9
web/build.config.js
web/build.config.js
+18
-0
web/public/index.html
web/public/index.html
+4
-4
web/vue.config.js
web/vue.config.js
+25
-5
未找到文件。
web/build.config.js
0 → 100644
浏览文件 @
521ef793
'
use strict
'
module
.
exports
=
{
title
:
'
GIN-VUE-ADMIN1
'
,
baseCdnUrl
:
'
//cdn.staticfile.org
'
,
cdns
:
[
/**
* 如果设置path属性, { name: 'vue', scope: 'Vue', path: '/vue/2.6.9/vue.min.js' } 即编译出来以[baseCdnUrl][path]
* 否则自动拼写 [baseCdnUrl]/[name]/[version]/[name].min.js
* */
{
name
:
'
vue
'
,
scope
:
'
Vue
'
},
{
name
:
'
vue-router
'
,
scope
:
'
VueRouter
'
},
{
name
:
'
vuex
'
,
scope
:
'
Vuex
'
},
{
name
:
'
axios
'
,
scope
:
'
axios
'
},
{
name
:
'
echarts
'
,
scope
:
'
echarts
'
},
{
name
:
'
element-ui
'
,
scope
:
'
ELEMENT
'
,
path
:
'
/element-ui/2.12.0/index.js
'
},
]
};
web/public/index.html
浏览文件 @
521ef793
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
GIN-VUE-ADMIN
</title>
<title>
<
%=
htmlWebpackPlugin.options.title
%
>
</title>
<
%
if
(
process.env.NODE_ENV
!=='
development
'){
%
>
<
%
if
(
process.env.NODE_ENV
!=='
development
'){
%
>
<script
src=
"//cdn.staticfile.org/vue/2.6.10/vue.min.js"
></script
>
<
%
htmlWebpackPlugin.options.cdns.forEach
(
function
(
item
){
if
(
item.js
){
%
>
<script
src=
"//cdn.staticfile.org/axios/0.19.0/axios.min.js
"
></script>
<script
type=
"text/javascript"
src=
"<%= item.js %>
"
></script>
<script
src=
"//cdn.staticfile.org/echarts/4.7.0/echarts.min.js"
></script>
<
%
}
})
%
>
<
%
}
%
>
<
%
}
%
>
</head>
</head>
...
...
web/vue.config.js
浏览文件 @
521ef793
'
use strict
'
'
use strict
'
const
path
=
require
(
'
path
'
)
const
path
=
require
(
'
path
'
)
const
buildConf
=
require
(
'
./build.config
'
)
const
packageConf
=
require
(
'
./package.json
'
)
function
resolve
(
dir
)
{
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
dir
)
return
path
.
join
(
__dirname
,
dir
)
...
@@ -63,13 +65,31 @@ module.exports = {
...
@@ -63,13 +65,31 @@ module.exports = {
// 不打包 begin
// 不打包 begin
// 1.目前已经测试通过[vue,axios,echarts]可以cdn引用,其它组件测试通过后可继续添加
// 1.目前已经测试通过[vue,axios,echarts]可以cdn引用,其它组件测试通过后可继续添加
// 2.此处添加不打包后,需在public/index.html head中添加相应cdn资源链接
// 2.此处添加不打包后,需在public/index.html head中添加相应cdn资源链接
config
.
set
(
'
externals
'
,
{
config
.
set
(
'
externals
'
,
buildConf
.
cdns
.
reduce
((
p
,
a
)
=>
{
vue
:
'
Vue
'
,
p
[
a
.
name
]
=
a
.
scope
axios
:
'
axios
'
,
return
p
echarts
:
'
echarts
'
},{}))
})
// 不打包 end
// 不打包 end
config
.
plugin
(
'
html
'
)
.
tap
(
args
=>
{
if
(
buildConf
.
title
)
{
args
[
0
].
title
=
buildConf
.
title
}
if
(
buildConf
.
cdns
.
length
>
0
)
{
args
[
0
].
cdns
=
buildConf
.
cdns
.
map
(
conf
=>
{
if
(
conf
.
path
)
{
conf
.
js
=
`
${
buildConf
.
baseCdnUrl
}${
conf
.
path
}
`
}
else
{
conf
.
js
=
`
${
buildConf
.
baseCdnUrl
}
/
${
conf
.
name
}
/
${
packageConf
.
dependencies
[
conf
.
name
].
replace
(
'
^
'
,
''
)}
/
${
conf
.
name
}
.min.js`
}
return
conf
})
}
return
args
})
config
config
.
plugin
(
'
ScriptExtHtmlWebpackPlugin
'
)
.
plugin
(
'
ScriptExtHtmlWebpackPlugin
'
)
.
after
(
'
html
'
)
.
after
(
'
html
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录