Skip to content

Commit 56e0392

Browse files
egoistyyx990803
authored andcommitted
fix: always transpile lib directory (#73)
1 parent f619e22 commit 56e0392

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/webpack/createBaseConfig.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,18 @@ module.exports = function createBaseConfig ({
7070
})
7171

7272
if (!siteConfig.evergreen) {
73+
const libDir = path.join(__dirname, '..')
7374
config.module
7475
.rule('js')
7576
.test(/\.js$/)
76-
.exclude.add(/node_modules/).end()
77+
.exclude.add(filepath => {
78+
// Always transpile lib directory
79+
if (filepath.startsWith(libDir)) {
80+
return false
81+
}
82+
// Don't transpile node_modules
83+
return /node_modules/.test(filepath)
84+
}).end()
7785
.use('buble-loader')
7886
.loader('buble-loader')
7987
.options({

0 commit comments

Comments
 (0)