From 6a38ed01a228a65331302fabebc556cb294cd261 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Fri, 6 Dec 2019 17:12:36 +0800 Subject: [PATCH 1/2] fix($core): transpile vuepress packages and md files --- .../core/lib/node/webpack/createBaseConfig.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js b/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js index 93723c260a..d817960b74 100644 --- a/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js +++ b/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js @@ -141,12 +141,15 @@ module.exports = function createBaseConfig (context, isServer) { if (filePath.startsWith(libDir)) { return false } - // always transpile js in vue files - if (/\.vue\.js$/.test(filePath)) { + // always transpile js in vue files and md files + if (/\.(vue|md)\.js$/.test(filePath)) { return false } - // transpile all core files - if (/(@vuepress|vuepress-)\/^((?!node_modules).)*\.js$/.test(filePath)) { + // transpile all core packages and vuepress related packages. + // i.e. + // @vuepress/* + // vuepress-* + if (/(@vuepress\/[^\/]*|vuepress-[^\/]*)\/(?!node_modules).*\.js$/.test(filePath)) { return false } // Don't transpile node_modules From a003f72d0187c4a125fc1e0cdca73fd51bc90a1a Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Thu, 9 Jan 2020 14:58:39 +0800 Subject: [PATCH 2/2] chore: tweaks --- packages/@vuepress/core/lib/node/webpack/createBaseConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js b/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js index d817960b74..13c30b679e 100644 --- a/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js +++ b/packages/@vuepress/core/lib/node/webpack/createBaseConfig.js @@ -149,7 +149,7 @@ module.exports = function createBaseConfig (context, isServer) { // i.e. // @vuepress/* // vuepress-* - if (/(@vuepress\/[^\/]*|vuepress-[^\/]*)\/(?!node_modules).*\.js$/.test(filePath)) { + if (/(@vuepress[\/\\][^\/\\]*|vuepress-[^\/\\]*)[\/\\](?!node_modules).*\.js$/.test(filePath)) { return false } // Don't transpile node_modules