Skip to content

Commit c15988b

Browse files
committed
fix($core): transpile vuepress packages and md files
1 parent 5c1e7a4 commit c15988b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/@vuepress/core/lib/node/webpack/createBaseConfig.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,15 @@ module.exports = function createBaseConfig (context, isServer) {
141141
if (filePath.startsWith(libDir)) {
142142
return false
143143
}
144-
// always transpile js in vue files
145-
if (/\.vue\.js$/.test(filePath)) {
144+
// always transpile js in vue files and md files
145+
if (/\.(vue|md)\.js$/.test(filePath)) {
146146
return false
147147
}
148-
// transpile all core files
149-
if (/(@vuepress|vuepress-)\/^((?!node_modules).)*\.js$/.test(filePath)) {
148+
// transpile all core packages and vuepress related packages.
149+
// i.e.
150+
// @vuepress/*
151+
// vuepress-*
152+
if (/(@vuepress\/[^\/]*|vuepress-[^\/]*)\/(?!node_modules).*\.js$/.test(filePath)) {
150153
return false
151154
}
152155
// Don't transpile node_modules

0 commit comments

Comments
 (0)