perf(CLI): improve markdown compile performance (#12541)

This commit is contained in:
neverland
2023-12-31 11:39:45 +00:00
committed by GitHub
parent 5bc2f815af
commit b49c640789
2 changed files with 32 additions and 22 deletions
+2 -16
View File
@@ -79,22 +79,8 @@ export async function compileSite(isProd = false) {
templateParameters: getTemplateParams(),
},
tools: {
bundlerChain(chain, { CHAIN_ID }) {
const vueRule = chain.module.rules
.get(CHAIN_ID.RULE.VUE)
.use(CHAIN_ID.USE.VUE);
const vueLoader = vueRule.get('loader');
const vueOptions = vueRule.get('options');
chain.module
.rule('md')
.test(/\.md$/)
.use('vue')
.loader(vueLoader)
.options(vueOptions)
.end()
.use('md')
.loader(MD_LOADER);
bundlerChain(chain) {
chain.module.rule('md').test(/\.md$/).use('md').loader(MD_LOADER);
},
rspack: {
plugins: [