From 4dded17304d6c873e50aafeb55128b649e2ea41f Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Fri, 11 Dec 2020 12:10:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20gh-pages=20=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98=20(#1176)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fis-conf.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fis-conf.js b/fis-conf.js index 2a8e66c4f..0de66713e 100644 --- a/fis-conf.js +++ b/fis-conf.js @@ -710,7 +710,6 @@ if (fis.project.currentMedia() === 'publish') { '!/examples/style.scss', '!monaco-editor/**', '!/scss/utilities.scss', - '/scss/utilities.scss', '/examples/style.scss' // 让它在最下面 ] }), @@ -724,12 +723,14 @@ if (fis.project.currentMedia() === 'publish') { const indexHtml = ret.src['/examples/index.html']; const appJs = ret.src['/examples/components/App.tsx']; const DocJs = ret.src['/examples/components/Doc.tsx']; + const DocCSS = ret.src['/examples/components/CssDocs.tsx']; const ExampleJs = ret.src['/examples/components/Example.tsx']; const pages = []; const source = [ appJs.getContent(), DocJs.getContent(), + DocCSS.getContent(), ExampleJs.getContent() ].join('\n'); source.replace( @@ -758,7 +759,16 @@ if (fis.project.currentMedia() === 'publish') { }); ghPages.match('*.{css,less,scss}', { - optimizer: fis.plugin('clean-css'), + optimizer: [ + function(contents) { + if (typeof contents === 'string') { + contents = contents.replace(/\/\*\!markdown[\s\S]*?\*\//g, ''); + } + + return contents; + }, + fis.plugin('clean-css') + ], useHash: true });