2020-12-17 00:18:46 -06:00
|
|
|
require('source-map-support/register');
|
2020-12-07 03:24:45 -06:00
|
|
|
// Whilst the configuration object can be modified here, the recommended way of making
|
|
|
|
// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead.
|
|
|
|
// Neutrino's inspect feature can be used to view/export the generated configuration.
|
2020-12-17 01:34:46 -06:00
|
|
|
const {Latus} = require('@latus/core');
|
2020-12-07 03:24:45 -06:00
|
|
|
const neutrino = require('neutrino');
|
|
|
|
|
2020-12-07 05:48:17 -06:00
|
|
|
if (process.env.LATUS_LINTING) {
|
|
|
|
// eslint-disable-next-line global-require
|
|
|
|
module.exports = neutrino(require('./.neutrinorc')).webpack();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
module.exports = new Promise((resolve, reject) => {
|
|
|
|
try {
|
2020-12-17 01:34:46 -06:00
|
|
|
const latus = Latus.create();
|
2020-12-07 05:48:17 -06:00
|
|
|
const configs = {
|
|
|
|
// eslint-disable-next-line global-require
|
|
|
|
app: require('./.neutrinorc'),
|
|
|
|
};
|
|
|
|
latus.invokeFlat('@latus/core/build', configs);
|
|
|
|
const webpackConfigs = Object.values(configs).map((config) => neutrino(config).webpack());
|
|
|
|
resolve(webpackConfigs);
|
|
|
|
}
|
|
|
|
catch (error) {
|
|
|
|
reject(error);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|