提交 556c6921 编写于 作者: yma16's avatar yma16

perf:gzip打包优化-build分支 dev 配置合入master

上级 eec44107
......@@ -13,6 +13,9 @@ const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
//cdn 配置
let externalConfig = []
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
......@@ -55,7 +58,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
inject: true,
cdnConfig: externalConfig, // cdn配置
}),
// copy custom myblog_static assets
new CopyWebpackPlugin([
......
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
// import Vue from 'vue'
// import VueRouter from 'vue-router'
// import axios from 'axios'
// import hljs from 'highlight.js'
//vue cdn
import Vue from 'vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import hljs from 'highlight.js'
import importElementComponents from './importElement'
import importEchartsComponents from './importEchartsComponents'
// 样式cnd
import 'github-markdown-css/github-markdown.css'
import 'nprogress/nprogress.css'
// 无需cdn
import useRouter from './router'
import cookies from 'vue-cookies'
import App from './App'
// import importElementComponents from './importElement'
// import importEchartsComponents from './importEchartsComponents'
// 样式
// import 'github-markdown-css/github-markdown.css'
// import 'nprogress/nprogress.css'
import 'highlight.js/styles/github.css'
import * as echarts from 'echarts/core'
......@@ -23,12 +25,6 @@ if (env === 'production') {
// 路由
const router = useRouter(Vue, VueRouter)
// // 按需引入elementui
// importElementComponents(Vue)
//
// // 按需引入echarts
// importEchartsComponents(Vue)
Vue.config.productionTip = false
Vue.use(cookies)
Vue.use(hljs)
......
......@@ -9,7 +9,6 @@ const Bilicom = () => import('@/components/Bilicom')
const Mavoneditor = () => import('@/components/Mavoneditor')
const GrilShow = () => import('@/components/GrilShow')
const Csslearn = () => import('@/components/Csslearn')
const defaultRoutes = [
{
path: '/',
......
// import Vue from 'vue'
// import Vuex from 'vuex'
import Vue from 'vue'
import Vuex from 'vuex'
import persistedstate from 'vuex-persistedstate'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册