parameterize build, export, import of async vs. async-es

This commit is contained in:
Michael Bradley, Jr 2018-08-31 17:03:55 -05:00
parent 9f46dcc49f
commit 72db70c5c3
6 changed files with 21 additions and 4 deletions

View File

@ -5,6 +5,7 @@
"browser": {
"ignore": [
"src/embark.js",
"src/node/async.js",
"src/node/index.js",
"src/standalone/index.js"
],
@ -22,7 +23,20 @@
]
},
"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": [
["@babel/plugin-transform-runtime", {
"corejs": 2

View File

@ -17,9 +17,10 @@
"src"
],
"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: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",
"clean": "rimraf dist embark.min.js embarkjs-*.tgz package",
"http-server": "http-server",

1
src/async.js Normal file
View File

@ -0,0 +1 @@
export {detectSeries, reduce} from 'async-es';

View File

@ -1,4 +1,4 @@
import {reduce} from 'async'
import {reduce} from './async'
function isNewWeb3_1() {
return (typeof(web3.version) === "string");

1
src/node/async.js Normal file
View File

@ -0,0 +1 @@
export {detectSeries, reduce} from 'async';

View File

@ -1,4 +1,4 @@
import {detectSeries} from 'async';
import {detectSeries} from './async';
const Storage = {};