refactor: only build

This commit is contained in:
cha0s 2020-12-02 17:13:54 -06:00
parent 469fb2dc9f
commit aec2e98ffb

View File

@ -1,4 +1,3 @@
import {spawn} from 'child_process';
import {createHttpServer} from './server';
let httpServer;
@ -12,21 +11,8 @@ export const $$latus = {
port: 32340,
}),
'@latus/core/build': (configs) => {
// eslint-disable-next-line no-console
if ('production' === process.env.NODE_ENV) {
// eslint-disable-next-line global-require, no-param-reassign
configs.client = require('./build/.neutrinorc');
}
else {
const binary = `$(npm --prefix ${process.cwd()} bin)/webpack-dev-server`;
const config = `${__dirname}/src/build/webpack.config.js`;
const options = {
shell: true,
stdio: 'inherit',
};
process.stdout.write(`${binary} --mode development --config ${config}\n`);
spawn(`${binary} --mode development --config ${config}`, options);
}
},
'@latus/core/up': async (plugins, next) => {
httpServer = await createHttpServer(plugins);