1
0
Fork 0
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:
Arunoda Susiripala 2017-02-09 08:32:58 +05:30 committed by GitHub
parent 9348762f4a
commit bdcb0f7828
2 changed files with 16 additions and 5 deletions

View file

@ -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"]
}
}
} }

View file

@ -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"
} }
} }