embark/packages/embarkjs/.babelrc.js
Michael Bradley, Jr 9f0a370c34 refactor: add embarkjs to the monorepo
Don't import git history of embark-framework/EmbarkJS, simply copy over the
sources. Modify `package.json`, etc. re: being situated in the monorepo.

Make use of the root babel config but extend with
`packages/embarkjs/.babelrc.js`.

Build `test/` scripts into `build-test/` and git-ignore `build-test/`.

Revise `Blockchain.connect()` so that if the caller supplies a callback then a
promise is not returned.

Revise tests to test `Blockchain.connect()` usage with and without a callback.
2019-02-08 11:58:02 -06:00

50 lines
853 B
JavaScript

/* global module require */
const cloneDeep = require('lodash.clonedeep');
module.exports = (api) => {
const env = api.env();
const base = {};
const browser = cloneDeep(base);
Object.assign(browser, {
ignore: [
'src/embark.js',
'src/node/async.js',
'src/node/index.js'
]
});
const node = cloneDeep(base);
Object.assign(node, {
ignore: [
'src/async.js',
'src/browser.js',
'src/node/async.js'
]
});
const nodeAsync = cloneDeep(base);
Object.assign(nodeAsync, {
ignore: [
'src/node/index.js'
]
});
const nodeTest = cloneDeep(base);
switch (env) {
case 'browser':
return browser;
case 'node':
return node;
case 'node:async':
return nodeAsync;
case 'node:test':
return nodeTest;
default:
return base;
}
};