Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function run(entries: Array, command: any) {
entries = entries.map(entry => path.resolve(entry));
if (entries.length === 0) {
console.log('No entries found');
return;
}
let Parcel = require('@parcel/core').default;
let packageManager = new NodePackageManager(new NodeFS());
let defaultConfig: ParcelConfigFile = await packageManager.require(
'@parcel/config-default',
__filename
);
let parcel = new Parcel({
entries,
packageManager,
defaultConfig: {
...defaultConfig,
filePath: (await packageManager.resolve(
'@parcel/config-default',
__filename
)).resolved
},
patchConsole: true,
...(await normalizeOptions(command))
});
if (command.name() === 'watch' || command.name() === 'serve') {
let {unsubscribe} = await parcel.watch(err => {
if (err) {