From 1ad770ce8ba74b23993d579451eef995685d30c6 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 8 Jul 2018 11:05:27 +0800 Subject: [PATCH] fix: override style issues 1. duplicated generated override style 2. unexpected style order, override style should be at the end of the extracted style bundle. (ref: https://github.com/webpack-contrib/mini-css-extract-plugin/pull/130) --- lib/app/app.js | 3 +++ lib/default-theme/styles/config.styl | 2 -- lib/webpack/createBaseConfig.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/app/app.js b/lib/app/app.js index a1c8e43dfc..c5e39c30a4 100644 --- a/lib/app/app.js +++ b/lib/app/app.js @@ -7,6 +7,9 @@ import { siteData } from '@temp/siteData' import enhanceApp from '@temp/enhanceApp' import themeEnhanceApp from '@temp/themeEnhanceApp' +// generated from user config +import('@temp/override.styl') + // built-in components import Content from './components/Content' import OutboundLink from './components/OutboundLink.vue' diff --git a/lib/default-theme/styles/config.styl b/lib/default-theme/styles/config.styl index 385551e054..369302a205 100644 --- a/lib/default-theme/styles/config.styl +++ b/lib/default-theme/styles/config.styl @@ -17,5 +17,3 @@ $MQMobileNarrow = 419px // code $lineNumbersWrapperWidth = 3.5rem - -@import '~@temp/override.styl' // generated from user config diff --git a/lib/webpack/createBaseConfig.js b/lib/webpack/createBaseConfig.js index d8fa94d6a0..428344cb78 100644 --- a/lib/webpack/createBaseConfig.js +++ b/lib/webpack/createBaseConfig.js @@ -49,7 +49,7 @@ module.exports = function createBaseConfig ({ : path.resolve(__dirname, './noopModule.js')) .end() .extensions - .merge(['.js', '.jsx', '.vue', '.json']) + .merge(['.js', '.jsx', '.vue', '.json', '.styl']) .end() .modules // prioritize our own