latus/app/webpack.config.js

26 lines
737 B
JavaScript
Raw Normal View History

2020-12-20 03:51:38 -06:00
require('source-map-support/register');
const {Latus} = require('@latus/core');
const neutrino = require('neutrino');
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 {
const latus = Latus.create();
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);
}
});
}