Created
September 19, 2016 23:04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
module.exports = { | |
// Don't try to find .babelrc because we want to force this configuration. | |
babelrc: false, | |
// This is a feature of `babel-loader` for webpack (not Babel itself). | |
// It enables caching results in OS temporary directory for faster rebuilds. | |
cacheDirectory: true, | |
presets: [ | |
// Latest stable ECMAScript features | |
'modern', | |
'modern/safari9', | |
'modern/stage1', | |
// JSX, Flow | |
require.resolve('babel-preset-react') | |
], | |
plugins: [ | |
// Support for React Hot Loader 3 | |
require.resolve('react-hot-loader/babel'), | |
// class { handleClick = () => { } } | |
require.resolve('babel-plugin-transform-class-properties'), | |
// { ...todo, completed: true } | |
require.resolve('babel-plugin-transform-object-rest-spread'), | |
// function* () { yield 42; yield 43; } | |
[require.resolve('babel-plugin-transform-regenerator'), { | |
// Async functions are converted to generators by babel-preset-latest | |
async: false | |
}], | |
// Polyfills the runtime needed for async/await and generators | |
[require.resolve('babel-plugin-transform-runtime'), { | |
helpers: false, | |
polyfill: false, | |
regenerator: true, | |
// Resolve the Babel runtime relative to the config. | |
// You can safely remove this after ejecting: | |
moduleName: path.dirname(require.resolve('babel-runtime/package')) | |
}] | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment