mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
1719738ed1
* Add a way to customize babel configurations. * Add babel configuration docs to README.
16 lines
536 B
JavaScript
16 lines
536 B
JavaScript
// This file is not going through babel transformation.
|
|
// So, we write it in vanilla JS
|
|
// (But you could use ES2015 features supported by your Node.js version)
|
|
|
|
module.exports = {
|
|
// config is the set of options we pass to our babel-loaders's query option
|
|
babel: function (config) {
|
|
// Add the stage-0 preset.
|
|
// Make sure to use 'require.resolve' otherwise we won't be able to find it.
|
|
config.presets.push(require.resolve('babel-preset-stage-0'))
|
|
|
|
// Important: return the modified config
|
|
return config
|
|
}
|
|
}
|