refactor: latus
This commit is contained in:
parent
f141b6a81b
commit
4ae5307ae1
|
@ -2,9 +2,7 @@ require('source-map-support/register');
|
|||
// 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.
|
||||
const {join} = require('path');
|
||||
|
||||
const {readConfig, Latus} = require('@latus/core');
|
||||
const {Latus} = require('@latus/core');
|
||||
const neutrino = require('neutrino');
|
||||
|
||||
if (process.env.LATUS_LINTING) {
|
||||
|
@ -14,22 +12,7 @@ if (process.env.LATUS_LINTING) {
|
|||
else {
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
try {
|
||||
const config = readConfig();
|
||||
const paths = Object.entries(config).map(([plugin]) => {
|
||||
try {
|
||||
const local = join(process.cwd(), 'src', plugin);
|
||||
require.resolve(local);
|
||||
return local;
|
||||
}
|
||||
catch (error) {
|
||||
return plugin;
|
||||
}
|
||||
});
|
||||
const latus = new Latus({
|
||||
config,
|
||||
// eslint-disable-next-line global-require, import/no-dynamic-require
|
||||
modules: paths.map((path) => require(path)),
|
||||
});
|
||||
const latus = Latus.create();
|
||||
const configs = {
|
||||
// eslint-disable-next-line global-require
|
||||
app: require('./.neutrinorc'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user