From 2c72fddd6844ed4447cadb14c9e8d66f17659dff Mon Sep 17 00:00:00 2001 From: Sendya <18x@loacg.com> Date: Mon, 25 Nov 2019 09:47:49 +0800 Subject: [PATCH] fix: menu-nav theme replace space class - update vue.config.js --- config/plugin.config.js | 3 +++ vue.config.js | 31 ++++++++++++------------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/config/plugin.config.js b/config/plugin.config.js index 72b40520ad..2ad9b1947f 100644 --- a/config/plugin.config.js +++ b/config/plugin.config.js @@ -24,13 +24,16 @@ const themePluginOption = { case '.ant-btn.active,.ant-btn:active': return '.ant-btn.active:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:active:not(.ant-btn-primary):not(.ant-btn-danger)' case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon': + case '.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon': return ':not(.ant-steps-item-process)' + selector case '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover': case '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal > .ant-menu-submenu-selected,.ant-menu-horizontal > .ant-menu-submenu:hover': return '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu:hover' case '.ant-menu-horizontal > .ant-menu-item-selected > a': + case '.ant-menu-horizontal>.ant-menu-item-selected>a': return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item-selected > a' case '.ant-menu-horizontal > .ant-menu-item > a:hover': + case '.ant-menu-horizontal>.ant-menu-item>a:hover': return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item > a:hover' default : return selector diff --git a/vue.config.js b/vue.config.js index 1ad359b7c3..e6233049e1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,15 +6,16 @@ function resolve (dir) { return path.join(__dirname, dir) } -/** - * check production or preview(pro.loacg.com only) - * @returns {boolean} - */ -function isProd () { - return process.env.NODE_ENV === 'production' -} +const isProd = process.env.NODE_ENV === 'production' const assetsCDN = { + // webpack build externals + externals: { + vue: 'Vue', + 'vue-router': 'VueRouter', + vuex: 'Vuex', + axios: 'axios' + }, css: [], // https://unpkg.com/browse/vue@2.6.10/ js: [ @@ -25,14 +26,6 @@ const assetsCDN = { ] } -// webpack build externals -const prodExternals = { - vue: 'Vue', - 'vue-router': 'VueRouter', - vuex: 'Vuex', - axios: 'axios' -} - // vue.config.js const vueConfig = { configureWebpack: { @@ -41,8 +34,8 @@ const vueConfig = { // Ignore all locale files of moment.js new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/) ], - // if prod is on, add externals - externals: isProd() ? prodExternals : {} + // if prod, add externals + externals: isProd ? assetsCDN.externals : {} }, chainWebpack: (config) => { @@ -67,7 +60,7 @@ const vueConfig = { // if prod is on // assets require on cdn - if (isProd()) { + if (isProd) { config.plugin('html').tap(args => { args[0].cdn = assetsCDN return args @@ -85,7 +78,7 @@ const vueConfig = { // 'link-color': '#F5222D', // 'border-radius-base': '4px' }, - // do not remove this line + // DO NOT REMOVE THIS LINE javascriptEnabled: true } }