mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add support to transpile import/export syntax (#1044)
next/babel doesn't transpile import/export. So, we need to do it explicitly, but only for test env.
This commit is contained in:
parent
9348762f4a
commit
bdcb0f7828
|
@ -1,3 +1,15 @@
|
||||||
{
|
{
|
||||||
|
"env": {
|
||||||
|
"development": {
|
||||||
"presets": ["next/babel"]
|
"presets": ["next/babel"]
|
||||||
|
},
|
||||||
|
"production": {
|
||||||
|
"presets": ["next/babel"]
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
// next/babel does not transpile import/export syntax.
|
||||||
|
// So, using es2015 in the beginning will fix that.
|
||||||
|
"presets": ["es2015", "next/babel"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,8 @@
|
||||||
"babel-jest": "^18.0.0",
|
"babel-jest": "^18.0.0",
|
||||||
"enzyme": "^2.5.1",
|
"enzyme": "^2.5.1",
|
||||||
"jest-cli": "^18.0.0",
|
"jest-cli": "^18.0.0",
|
||||||
"react": "^15.3.2",
|
"react-addons-test-utils": "^15.4.2",
|
||||||
"react-addons-test-utils": "^15.3.2",
|
"babel-preset-es2015": "^6.22.0",
|
||||||
"react-dom": "^15.3.2",
|
"react-test-renderer": "^15.4.2"
|
||||||
"react-test-renderer": "^15.4.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue