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: { DATE: {
type: 'DATE', type: 'DATE',
text: '年月型' text: '年月型'
}, },
DAY: { DAY: {
type: 'DAY', type: 'DAY',
text: '年月型' text: '年月型'
}, },
ID: { ID: {
type: 'ID', type: 'ID',

View File

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