2019-06-02 17:03:50 +00:00
|
|
|
const cloneDeep = require('lodash.clonedeep');
|
|
|
|
|
|
|
|
module.exports = (api) => {
|
|
|
|
const env = api.env();
|
|
|
|
|
|
|
|
const base = {};
|
|
|
|
|
|
|
|
const browser = cloneDeep(base);
|
|
|
|
Object.assign(browser, {
|
2020-02-20 23:47:01 +00:00
|
|
|
ignore: ['src/node']
|
2019-06-02 17:03:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const node = cloneDeep(base);
|
|
|
|
|
2019-09-18 19:30:41 +00:00
|
|
|
const test = cloneDeep(node);
|
2019-06-02 17:03:50 +00:00
|
|
|
|
|
|
|
switch (env) {
|
|
|
|
case 'browser':
|
|
|
|
return browser;
|
|
|
|
case 'node':
|
|
|
|
return node;
|
2019-09-18 19:30:41 +00:00
|
|
|
case 'test':
|
|
|
|
return test;
|
2019-06-02 17:03:50 +00:00
|
|
|
default:
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
};
|