refactor: only build
This commit is contained in:
parent
469fb2dc9f
commit
aec2e98ffb
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user