Skip to content

Commit 84b2322

Browse files
committed
fix(regenerator): Use babel transform-runtime instead manual requiring
1 parent a99d10e commit 84b2322

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

.babelrc

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"plugins": [
1010
"transform-object-rest-spread",
1111
"transform-class-properties",
12-
"transform-flow-strip-types"
12+
"transform-flow-strip-types",
13+
["transform-runtime", {
14+
"helpers": false,
15+
"polyfill": false,
16+
"regenerator": true,
17+
}]
1318
]
1419
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"babel-plugin-transform-class-properties": "^6.24.1",
3030
"babel-plugin-transform-flow-strip-types": "^6.22.0",
3131
"babel-plugin-transform-object-rest-spread": "^6.22.0",
32+
"babel-plugin-transform-runtime": "^6.23.0",
3233
"babel-preset-env": "^1.5.2",
3334
"cz-conventional-changelog": "^2.0.0",
3435
"eslint": "^4.0.0",
@@ -46,13 +47,13 @@
4647
"semantic-release": "^7.0.1"
4748
},
4849
"dependencies": {
50+
"babel-runtime": "^6.26.0",
4951
"debug": "^3.0.0",
5052
"get-port": "^3.1.0",
5153
"glob": "^7.1.2",
5254
"lockfile": "^1.0.3",
5355
"mkdirp": "^0.5.1",
5456
"mongodb-download": "^2.2.3",
55-
"regenerator-runtime": "^0.11.0",
5657
"tmp": "^0.0.33",
5758
"uuid": "^3.0.1"
5859
},

src/MongoMemoryServer.js

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import getport from 'get-port';
77
import Debug from 'debug';
88
import MongoInstance from './util/MongoInstance';
99

10-
require('regenerator-runtime/runtime'); // eslint-disable-line
1110
tmp.setGracefulCleanup();
1211

1312
export type MongoMemoryServerOptsT = {

src/util/MongoBinary.js

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import path from 'path';
77
import LockFile from 'lockfile';
88
import mkdirp from 'mkdirp';
99

10-
require('regenerator-runtime/runtime'); // eslint-disable-line
11-
1210
export type MongoBinaryCache = {
1311
[version: string]: string,
1412
};

src/util/MongoInstance.js

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import path from 'path';
66
import MongoBinary from './MongoBinary';
77
import type { MongoBinaryOpts } from './MongoBinary';
88

9-
require('regenerator-runtime/runtime'); // eslint-disable-line
10-
119
export type MongodOps = {
1210
// instance options
1311
instance: {

yarn.lock

+13
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,12 @@ babel-plugin-transform-regenerator@^6.22.0:
725725
dependencies:
726726
regenerator-transform "0.9.11"
727727

728+
babel-plugin-transform-runtime@^6.23.0:
729+
version "6.23.0"
730+
resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee"
731+
dependencies:
732+
babel-runtime "^6.22.0"
733+
728734
babel-plugin-transform-strict-mode@^6.24.1:
729735
version "6.24.1"
730736
resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"
@@ -800,6 +806,13 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0:
800806
core-js "^2.4.0"
801807
regenerator-runtime "^0.10.0"
802808

809+
babel-runtime@^6.26.0:
810+
version "6.26.0"
811+
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
812+
dependencies:
813+
core-js "^2.4.0"
814+
regenerator-runtime "^0.11.0"
815+
803816
babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.25.0:
804817
version "6.25.0"
805818
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071"

0 commit comments

Comments
 (0)