parameterize build, export, import of async vs. async-es
This commit is contained in:
parent
9f46dcc49f
commit
72db70c5c3
16
.babelrc
16
.babelrc
|
@ -5,6 +5,7 @@
|
||||||
"browser": {
|
"browser": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"src/embark.js",
|
"src/embark.js",
|
||||||
|
"src/node/async.js",
|
||||||
"src/node/index.js",
|
"src/node/index.js",
|
||||||
"src/standalone/index.js"
|
"src/standalone/index.js"
|
||||||
],
|
],
|
||||||
|
@ -22,7 +23,20 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node": {
|
"node": {
|
||||||
"ignore": ["src/browser.js"],
|
"ignore": ["src/browser.js", "src/node/async.js"],
|
||||||
|
"plugins": [
|
||||||
|
["@babel/plugin-transform-runtime", {
|
||||||
|
"corejs": 2
|
||||||
|
}]
|
||||||
|
],
|
||||||
|
"presets": [
|
||||||
|
["@babel/env", {
|
||||||
|
"targets": {"node": "8.11.3"}
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"node:async": {
|
||||||
|
"ignore": ["src/node/index.js"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
["@babel/plugin-transform-runtime", {
|
["@babel/plugin-transform-runtime", {
|
||||||
"corejs": 2
|
"corejs": 2
|
||||||
|
|
|
@ -17,9 +17,10 @@
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"babel": "npm run babel:browser && npm run babel:node",
|
"babel": "npm run babel:browser && npm run babel:node && npm run babel:node:async",
|
||||||
"babel:browser": "cross-env BABEL_ENV=browser babel --out-dir dist/browser src",
|
"babel:browser": "cross-env BABEL_ENV=browser babel --out-dir dist/browser src",
|
||||||
"babel:node": "cross-env BABEL_ENV=node babel --out-dir dist src",
|
"babel:node": "cross-env BABEL_ENV=node babel --out-dir dist src",
|
||||||
|
"babel:node:async": "cross-env BABEL_ENV=node:async babel --out-dir dist src/node",
|
||||||
"build": "npm run clean && npm run babel && npm run webpack",
|
"build": "npm run clean && npm run babel && npm run webpack",
|
||||||
"clean": "rimraf dist embark.min.js embarkjs-*.tgz package",
|
"clean": "rimraf dist embark.min.js embarkjs-*.tgz package",
|
||||||
"http-server": "http-server",
|
"http-server": "http-server",
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export {detectSeries, reduce} from 'async-es';
|
|
@ -1,4 +1,4 @@
|
||||||
import {reduce} from 'async'
|
import {reduce} from './async'
|
||||||
|
|
||||||
function isNewWeb3_1() {
|
function isNewWeb3_1() {
|
||||||
return (typeof(web3.version) === "string");
|
return (typeof(web3.version) === "string");
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export {detectSeries, reduce} from 'async';
|
|
@ -1,4 +1,4 @@
|
||||||
import {detectSeries} from 'async';
|
import {detectSeries} from './async';
|
||||||
|
|
||||||
const Storage = {};
|
const Storage = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue