Skip to content

Commit

Permalink
fix: always transpile lib directory (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist authored and yyx990803 committed Apr 16, 2018
1 parent f619e22 commit 56e0392
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/webpack/createBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,18 @@ module.exports = function createBaseConfig ({
})

if (!siteConfig.evergreen) {
const libDir = path.join(__dirname, '..')
config.module
.rule('js')
.test(/\.js$/)
.exclude.add(/node_modules/).end()
.exclude.add(filepath => {
// Always transpile lib directory
if (filepath.startsWith(libDir)) {
return false
}
// Don't transpile node_modules
return /node_modules/.test(filepath)
}).end()
.use('buble-loader')
.loader('buble-loader')
.options({
Expand Down

0 comments on commit 56e0392

Please sign in to comment.