feat: support for configuring static resource paths.

pull/62/head
ruibaby 2020-01-11 13:06:01 +08:00
parent 9d4a3cc2fb
commit 6a5aba4605
4 changed files with 13 additions and 9 deletions

2
.env Normal file
View File

@ -0,0 +1,2 @@
NODE_ENV=production
PUBLIC_PATH=https://cdn.jsdelivr.net/npm/halo-admin@1.2.0/dist/

2
.env.development Normal file
View File

@ -0,0 +1,2 @@
NODE_ENV=development
PUBLIC_PATH=/

View File

@ -132,11 +132,11 @@ postApi.permalinkType = {
},
DATE: {
type: 'DATE',
text: '年月型'
text: '年月型'
},
DAY: {
type: 'DAY',
text: '年月型'
text: '年月型'
},
ID: {
type: 'ID',

View File

@ -15,19 +15,19 @@ const assetsCDN = {
axios: 'axios',
marked: 'marked'
},
css: [
],
css: [],
js: [
'//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
'//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js',
'//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
'//cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js',
'//cdn.jsdelivr.net/npm/marked@0.8.0/marked.min.js'
'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
'https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js',
'https://cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
'https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js',
'https://cdn.jsdelivr.net/npm/marked@0.8.0/marked.min.js'
]
}
// vue.config.js
module.exports = {
publicPath: process.env.PUBLIC_PATH,
configureWebpack: {
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)