parent
5dd62efed1
commit
eaaa3c1dda
|
@ -6,11 +6,22 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= webpackConfig.name %></title>
|
<title><%= webpackConfig.name %></title>
|
||||||
|
|
||||||
|
<!-- 引入样式 -->
|
||||||
|
<% for(var css of htmlWebpackPlugin.options.cdn.css) { %>
|
||||||
|
<link rel="stylesheet" href="<%=css%>">
|
||||||
|
<% } %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
|
<!-- 引入JS -->
|
||||||
|
<% for(var js of htmlWebpackPlugin.options.cdn.js) { %>
|
||||||
|
<script src="<%=js%>"></script>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import Vue from 'vue'
|
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import getters from './getters'
|
import getters from './getters'
|
||||||
import app from './modules/app'
|
import app from './modules/app'
|
||||||
import settings from './modules/settings'
|
import settings from './modules/settings'
|
||||||
import user from './modules/user'
|
import user from './modules/user'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
|
||||||
|
|
||||||
const store = new Vuex.Store({
|
const store = new Vuex.Store({
|
||||||
modules: {
|
modules: {
|
||||||
app,
|
app,
|
||||||
|
|
|
@ -51,9 +51,30 @@ module.exports = {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve('src')
|
'@': resolve('src')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
vue: 'Vue',
|
||||||
|
'element-ui': 'ELEMENT'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
chainWebpack(config) {
|
chainWebpack(config) {
|
||||||
|
const cdn = {
|
||||||
|
css: [
|
||||||
|
// element-ui css
|
||||||
|
'https://unpkg.com/element-ui/lib/theme-chalk/index.css'
|
||||||
|
],
|
||||||
|
js: [
|
||||||
|
// vue must at first!
|
||||||
|
'https://unpkg.com/vue/dist/vue.js',
|
||||||
|
// element-ui js
|
||||||
|
'https://unpkg.com/element-ui/lib/index.js'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
config.plugin('html')
|
||||||
|
.tap(args => {
|
||||||
|
args[0].cdn = cdn
|
||||||
|
return args
|
||||||
|
})
|
||||||
config.plugins.delete('preload') // TODO: need test
|
config.plugins.delete('preload') // TODO: need test
|
||||||
config.plugins.delete('prefetch') // TODO: need test
|
config.plugins.delete('prefetch') // TODO: need test
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue