fix(v2): Fix babel-loader not transpiling docusaurus package (#1661)

This commit is contained in:
Endi 2019-07-14 18:40:20 +07:00 committed by GitHub
parent ea19b35e90
commit e3c0803c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -1,5 +1,8 @@
# Docusaurus 2 Changelog # Docusaurus 2 Changelog
## 2.0.0-alpha.21
- Fix babel-loader not transpiling docusaurus package
## 2.0.0-alpha.20 ## 2.0.0-alpha.20
- Added Google analytics and Google gtag plugins. - Added Google analytics and Google gtag plugins.

View file

@ -125,8 +125,12 @@ export function createBaseConfig(
rules: [ rules: [
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
include: [siteDir, /docusaurus/], exclude: modulePath => {
exclude: /node_modules/, // Don't transpile node_modules except any docusaurus package
return (
/node_modules/.test(modulePath) && !/docusaurus/.test(modulePath)
);
},
use: [ use: [
cacheLoader && getCacheLoader(isServer), cacheLoader && getCacheLoader(isServer),
getBabelLoader(isServer), getBabelLoader(isServer),