-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use babel-polyfill and babel-preset-env #3790
Changes from all commits
7aafa5c
b52cad0
e7026e5
59ebb3f
1636d98
5bc0ca1
9ee6aca
a37be39
b34531c
f176e2b
abe749d
28ce70d
d461882
9555e02
3ce946e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
{ | ||
"only": "*.js", | ||
"env": { | ||
"pre-node5": { | ||
"presets": ["es2015-node4"], | ||
"node4": { | ||
"plugins": [ | ||
["array-includes"], | ||
["transform-inline-imports-commonjs"], | ||
["transform-runtime", { "polyfill": true, "regenerator": false }] | ||
] | ||
"transform-flow-strip-types", | ||
"transform-object-rest-spread", | ||
"transform-class-properties", | ||
"transform-inline-imports-commonjs" | ||
], | ||
"presets": [["env", { | ||
"targets": { | ||
"node": 4 | ||
}, | ||
"useBuiltIns": true | ||
}]] | ||
}, | ||
"node6": { | ||
"plugins": [ | ||
"transform-flow-strip-types", | ||
"transform-object-rest-spread", | ||
"transform-class-properties", | ||
"transform-inline-imports-commonjs" | ||
], | ||
"presets": [["env", { | ||
"targets": { | ||
"node": 6 | ||
}, | ||
"useBuiltIns": true | ||
}]] | ||
}, | ||
"test": { | ||
"presets": ["es2015-node4"], | ||
"plugins": [ | ||
["transform-inline-imports-commonjs"] | ||
] | ||
"transform-flow-strip-types", | ||
"transform-object-rest-spread", | ||
"transform-class-properties", | ||
"transform-inline-imports-commonjs" | ||
], | ||
"presets": [["env", { | ||
"targets": { | ||
"node": 4 | ||
}, | ||
"useBuiltIns": true | ||
}]] | ||
} | ||
}, | ||
"presets": ["node5", "stage-0"], | ||
"plugins": [ | ||
["transform-inline-imports-commonjs"], | ||
["transform-runtime", { "polyfill": false, "regenerator": true }] | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// flow-typed signature: cbd31882f6edff2e4390624598ed8b77 | ||
// flow-typed version: <<STUB>>/babel-polyfill_v^6.6.1/flow_v0.32.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* 'babel-polyfill' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module 'babel-polyfill' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module 'babel-polyfill/browser' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-polyfill/dist/polyfill' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-polyfill/dist/polyfill.min' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-polyfill/lib/index' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-polyfill/scripts/postpublish' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-polyfill/scripts/prepublish' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module 'babel-polyfill/browser.js' { | ||
declare module.exports: $Exports<'babel-polyfill/browser'>; | ||
} | ||
declare module 'babel-polyfill/dist/polyfill.js' { | ||
declare module.exports: $Exports<'babel-polyfill/dist/polyfill'>; | ||
} | ||
declare module 'babel-polyfill/dist/polyfill.min.js' { | ||
declare module.exports: $Exports<'babel-polyfill/dist/polyfill.min'>; | ||
} | ||
declare module 'babel-polyfill/lib/index.js' { | ||
declare module.exports: $Exports<'babel-polyfill/lib/index'>; | ||
} | ||
declare module 'babel-polyfill/scripts/postpublish.js' { | ||
declare module.exports: $Exports<'babel-polyfill/scripts/postpublish'>; | ||
} | ||
declare module 'babel-polyfill/scripts/prepublish.js' { | ||
declare module.exports: $Exports<'babel-polyfill/scripts/prepublish'>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"preferGlobal": true, | ||
"description": "📦🐈 Fast, reliable, and secure dependency management.", | ||
"dependencies": { | ||
"babel-polyfill": "^6.23.0", | ||
"babel-runtime": "^6.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"bytes": "^2.4.0", | ||
"camelcase": "^4.0.0", | ||
|
@@ -42,18 +43,15 @@ | |
"validate-npm-package-license": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.24.1", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^6.1.2", | ||
"babel-jest": "^19.0.0", | ||
"babel-jest": "^20.0.3", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-array-includes": "^2.0.3", | ||
"babel-plugin-transform-es2015-typeof-symbol": "^6.8.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-plugin-transform-inline-imports-commonjs": "^1.0.0", | ||
"babel-plugin-transform-runtime": "^6.4.3", | ||
"babel-preset-es2015-node4": "^2.1.0", | ||
"babel-preset-node5": "^10.2.0", | ||
"babel-preset-stage-0": "^6.0.0", | ||
"babylon": "^6.5.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-preset-env": "^1.5.2", | ||
"eslint": "^3.19.0", | ||
"eslint-config-fb-strict": "^20.0.1", | ||
"eslint-plugin-babel": "^3.3.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ const compiler = webpack({ | |
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
query: babelRc.env.node6, | ||
}, | ||
], | ||
}, | ||
|
@@ -58,7 +59,7 @@ const compilerLegacy = webpack({ | |
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
query: babelRc.env['pre-node5'], | ||
query: babelRc.env.node4, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can also be done by defining There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it ok if we open another issue/pull request on that? This pr is becoming too big imho. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kaylieEB can you open the issue? Because I don't fully understand your comment, I am afraid to write something wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np :) #3809 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks :D |
||
}, | ||
], | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,7 +145,7 @@ export async function executeLifecycleScript( | |
// Add global bin folder if it is not present already, as some packages depend | ||
// on a globally-installed version of node-gyp. | ||
const globalBin = getGlobalBinFolder(config, {}); | ||
if (pathParts.indexOf(globalBin) === -1) { | ||
if (!pathParts.includes(globalBin)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the advantage of this change? |
||
pathParts.unshift(globalBin); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to what @Volune said, maybe this can be "development", which babel uses as default.