mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add react-require to avoid importing React (#295)
* Add react-require * Add babel-plugin-react-require
This commit is contained in:
parent
fcd59adea1
commit
10b815b9c9
|
@ -33,6 +33,7 @@
|
||||||
"babel-generator": "6.19.0",
|
"babel-generator": "6.19.0",
|
||||||
"babel-loader": "6.2.8",
|
"babel-loader": "6.2.8",
|
||||||
"babel-plugin-module-resolver": "2.3.0",
|
"babel-plugin-module-resolver": "2.3.0",
|
||||||
|
"babel-plugin-react-require": "^3.0.0",
|
||||||
"babel-plugin-transform-async-to-generator": "6.16.0",
|
"babel-plugin-transform-async-to-generator": "6.16.0",
|
||||||
"babel-plugin-transform-class-properties": "6.19.0",
|
"babel-plugin-transform-class-properties": "6.19.0",
|
||||||
"babel-plugin-transform-object-rest-spread": "6.19.0",
|
"babel-plugin-transform-object-rest-spread": "6.19.0",
|
||||||
|
|
|
@ -118,6 +118,7 @@ export default async function createCompiler (dir, { hotReload = false, dev = fa
|
||||||
query: {
|
query: {
|
||||||
presets: ['es2015', 'react'],
|
presets: ['es2015', 'react'],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
require.resolve('babel-plugin-react-require'),
|
||||||
require.resolve('babel-plugin-transform-async-to-generator'),
|
require.resolve('babel-plugin-transform-async-to-generator'),
|
||||||
require.resolve('babel-plugin-transform-object-rest-spread'),
|
require.resolve('babel-plugin-transform-object-rest-spread'),
|
||||||
require.resolve('babel-plugin-transform-class-properties'),
|
require.resolve('babel-plugin-transform-class-properties'),
|
||||||
|
|
Loading…
Reference in a new issue