Skip to content

Commit

Permalink
Always add add-module-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Oct 5, 2016
1 parent c1a368e commit 97f083d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/utils/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,21 @@ export default function babelConfig (program, stage) {
findBabelPackage(directory) ||
defaultConfig()

// If using the user's babelrc, they might not have a plugin array.
if (!babelrc.plugins) {
babelrc.plugins = []
}

if (stage === `develop`) {
babelrc.plugins.unshift(`transform-react-jsx-source`)
babelrc.plugins.unshift(`react-hot-loader/babel`)
}

// Always add this plugin so our generated routes
// will work regardless of how users export
// their components. Yeah for multiple module standards!
babelrc.plugins.unshift(`add-module-exports`)

if (!babelrc.hasOwnProperty(`cacheDirectory`)) {
babelrc.cacheDirectory = true
}
Expand Down

0 comments on commit 97f083d

Please sign in to comment.