Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve) => {
const nuxt = new Nuxt(config);
nuxt.options.dev = true;
nuxt.options.build.quiet = true;
let stopProcessWhenDone = stopProcessIfCalledTimes(1, resolve);
nuxt.hook('build:before', (nuxt, buildOptions) => {
if (buildOptions.ssr) {
stopProcessWhenDone = stopProcessIfCalledTimes(2, resolve);
}
});
nuxt.hook('build:compile', ({ name, compiler }) => {
stopProcessWhenDone({ name, compiler });
});