How to use the @parcel/core.default function in @parcel/core

To help you get started, we’ve selected a few @parcel/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github parcel-bundler / parcel / packages / core / parcel / src / cli.js View on Github external
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) {

@parcel/core

MIT
Latest version published 6 days ago

Package Health Score

94 / 100
Full package analysis