mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
55f48563a0
* Add babel-preset-2016 support. This adds the support for Exponentiation operator (**) * Use babel-preset-latest. * Remove babel-plugin-transform-async-to-generator in favor of babel-plugin-latest It has es2017 preset and it comes with the above plugin.
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
const babelRuntimePath = require.resolve('babel-runtime/package')
|
|
.replace(/[\\/]package\.json$/, '')
|
|
|
|
module.exports = {
|
|
presets: [
|
|
[require.resolve('babel-preset-latest'), {
|
|
'es2015': { modules: false }
|
|
}],
|
|
require.resolve('babel-preset-react')
|
|
],
|
|
plugins: [
|
|
require.resolve('babel-plugin-react-require'),
|
|
require.resolve('babel-plugin-transform-object-rest-spread'),
|
|
require.resolve('babel-plugin-transform-class-properties'),
|
|
require.resolve('babel-plugin-transform-runtime'),
|
|
require.resolve('styled-jsx/babel'),
|
|
[
|
|
require.resolve('babel-plugin-module-resolver'),
|
|
{
|
|
alias: {
|
|
'babel-runtime': babelRuntimePath,
|
|
'next/link': require.resolve('../../../lib/link'),
|
|
'next/prefetch': require.resolve('../../../lib/prefetch'),
|
|
'next/css': require.resolve('../../../lib/css'),
|
|
'next/head': require.resolve('../../../lib/head'),
|
|
'next/document': require.resolve('../../../server/document'),
|
|
'next/router': require.resolve('../../../lib/router')
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|