forked from DevExpress/testcafe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update packages to reduce npm install warnings (closes DevExpress#769) (
DevExpress#1203) * Update packages to reduce npm install warnings (closes DevExpress#769) * Disable regenerator for node>=4
- Loading branch information
1 parent
b01a939
commit 946ef62
Showing
8 changed files
with
34 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
import NODE_VER from '../../utils/node-version'; | ||
|
||
function getOptsForPresetEnv () { | ||
var opts = { targets: { node: 'current' }, loose: true }; | ||
|
||
// NOTE: Disable transforming generators into state-machine for node>=4, because this versions have native generators. | ||
// Also this versions have native template literals, regenerator do not work with them: | ||
// https://github.com/facebook/regenerator/issues/276 | ||
if (NODE_VER >= 4) | ||
opts.exclude = ['transform-regenerator']; | ||
|
||
return opts; | ||
} | ||
|
||
// NOTE: lazy load heavy dependencies | ||
export default function loadBabelLibs () { | ||
return { | ||
babel: require('babel-core'), | ||
presetStage2: require('babel-preset-stage-2'), | ||
transformRuntime: require('babel-plugin-transform-runtime'), | ||
presetES2015Loose: require('babel-preset-es2015').buildPreset({ loose: true }), | ||
|
||
// NOTE: we don't need this preset if we are on older versions of Node | ||
presetES2015Node4: NODE_VER >= 4 ? require('babel-preset-es2015-node4') : null | ||
babel: require('babel-core'), | ||
presetStage2: require('babel-preset-stage-2'), | ||
transformRuntime: require('babel-plugin-transform-runtime'), | ||
presetFallback: require('babel-preset-env').default(null, { loose: true }), | ||
presetEnv: require('babel-preset-env').default(null, getOptsForPresetEnv()) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters