Skip to content

Commit

Permalink
chore: migrate to babel-preset-env (trivago#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayusharma committed Aug 16, 2018
1 parent 06fb3b4 commit 7b207df
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 231 deletions.
40 changes: 33 additions & 7 deletions .babelrc
@@ -1,24 +1,50 @@
{
"plugins": [
"transform-flow-strip-types",
"transform-object-rest-spread",
"lodash"
],
"env": {
"development": {
"presets": [["es2015", {modules: false, loose: true}], "stage-1", "react"],
"presets": [
[
"env",
{
"modules": false,
"loose": true
}
],
"react"
]
},
"production": {
"presets": [["es2015", {modules: false, loose: true}], "stage-1", "react"],
"presets": [
[
"env",
{
"modules": false,
"loose": true
}
],
"react"
],
"plugins": ["transform-inline-environment-variables"]
},
"release": {
"presets": [["es2015", {modules: false, loose: true}], "stage-1", "react"],
"presets": [
[
"env",
{
"modules": false,
"loose": true
}
],
"react"
]
},
"test": {
"presets": ["node6", "stage-1"],
"plugins": [
"transform-inline-environment-variables"
]
"presets": ["env"],
"plugins": ["transform-inline-environment-variables"]
}
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@
- Added PR template
- Fix rollup config to generate esm properly [#42](https://github.com/trivago/melody/pull/42)
- Added `testURL` in Jest config. [#49](https://github.com/trivago/melody/pull/49)
- Migation to `babel-preset-env`. [#50](https://github.com/trivago/melody/issues/50)

## 1.1.0

Expand Down
15 changes: 7 additions & 8 deletions package.json
Expand Up @@ -35,19 +35,18 @@
"@types/lodash": "^4.14.54",
"@types/node": "^7.0.7",
"babel-cli": "^6.23.0",
"babel-core": "^6.26.3",
"babel-eslint": "^7.1.1",
"babel-jest": "^22.0.6",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-lodash": "^3.2.11",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-inline-environment-variables": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-es2015-loose": "8.0.0",
"babel-preset-es2015-minimal-rollup": "^2.1.1",
"babel-preset-node6": "^11.0.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-1": "^6.22.0",
"babel-register": "^6.23.0",
"bundlesize": "^0.13.2",
"chai": "^3.0.0",
Expand All @@ -71,9 +70,9 @@
"redux-thunk": "^2.2.0",
"rimraf": "^2.6.1",
"rollup": "^0.63.5",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-json": "^2.1.0",
"rollup-plugin-uglify": "^2.0.1",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-json": "^3.0.0",
"rollup-plugin-uglify": "^4.0.0",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0",
"source-map": "^0.5.6",
Expand Down
22 changes: 20 additions & 2 deletions packages/melody-jest-transform/__tests__/customTransformSpec.js
Expand Up @@ -24,7 +24,16 @@ jest.mock('find-babel-config', () => ({
config: {
env: {
test: {
presets: ['node6', 'stage-1'],
presets: [
[
'env',
{
targets: {
node: '6',
},
},
],
],
plugins: ['transform-inline-environment-variables'],
},
},
Expand Down Expand Up @@ -67,7 +76,16 @@ describe('Custom transformer', () => {
const babel = {
env: {
test: {
presets: ['node6', 'stage-1'],
presets: [
[
'env',
{
targets: {
node: '6',
},
},
],
],
plugins: ['transform-inline-environment-variables'],
},
},
Expand Down
8 changes: 7 additions & 1 deletion rollup.config.js
Expand Up @@ -18,7 +18,13 @@ const config = {
format: 'cjs',
},
],
plugins: [json(), babel()],
plugins: [
json(),
babel({
exclude: 'node_modules/**',
plugins: ['external-helpers'],
}),
],
external: [
...Object.keys(pkgJSON.dependencies || {}),
...Object.keys(pkgJSON.peerDependencies || {}),
Expand Down

0 comments on commit 7b207df

Please sign in to comment.