Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(bundler as any).emit('bundle-ready');
}
});
krasConfig.map['/'] = '';
krasConfig.map[api] = '';
krasConfig.injectors = {
script: krasConfig.injectors.script || {
active: true,
},
[injectorName]: injectorConfig,
...krasConfig.injectors,
};
const krasServer = buildKrasWithCli(krasConfig);
krasServer.removeAllListeners('open');
krasServer.on('open', svc => {
const address = `${svc.protocol}://localhost:${chalk.green(svc.port)}`;
console.log(`${liveIcon} Running at ${chalk.bold(address)}.`);
console.log(`${settingsIcon} Manage via ${chalk.bold(address + krasConfig.api)}.`);
bundler.bundle();
});
await krasServer.start();
openBrowser(open, port);
await new Promise(resolve => krasServer.on('close', resolve));
}
const bundler = new Bundler(
entry,
extendConfig({
publicUrl,
logLevel,
}),
);
if (options.dependencies) {
extendBundlerForPiral(bundler);
}
extendBundlerWithPlugins(bundler);
krasConfig.map['/'] = `http://localhost:${buildServerPort}`;
const krasServer = buildKrasWithCli(krasConfig);
krasServer.removeAllListeners('open');
krasServer.on('open', svc => {
const address = `${svc.protocol}://localhost:${chalk.green(svc.port)}`;
console.log(`${liveIcon} Running at ${chalk.bold(address)}.`);
console.log(`${settingsIcon} Manage via ${chalk.bold(address + krasConfig.api)}.`);
startServer(buildServerPort, (bundler as any).middleware());
});
await krasServer.start();
await new Promise(() => {});
}
};
extendBundlerForPiral(bundler);
extendBundlerWithPlugins(bundler);
krasConfig.map['/'] = '';
krasConfig.injectors = {
script: krasConfig.injectors.script || {
active: true,
},
[injectorName]: injectorConfig,
...krasConfig.injectors,
};
const krasServer = buildKrasWithCli(krasConfig);
krasServer.removeAllListeners('open');
krasServer.on('open', svc => {
const address = `${svc.protocol}://localhost:${chalk.green(svc.port)}`;
console.log(`${liveIcon} Running at ${chalk.bold(address)}.`);
console.log(`${settingsIcon} Manage via ${chalk.bold(address + krasConfig.api)}.`);
bundler.bundle();
});
await krasServer.start();
openBrowser(open, port);
await new Promise(resolve => krasServer.on('close', resolve));
}