{"id":15757,"library":"piral-cli-parcel","title":"Piral CLI Parcel Bundler Plugin","description":"Piral CLI Parcel is a plugin designed to integrate Parcel Bundler (specifically Parcel v1) into the Piral CLI ecosystem. It enables developers to use Parcel for bundling both Piral instances and individual pilets, simplifying the build and debug processes. The current stable version is v1.1.0, with ongoing active development and recent updates including a move to a dedicated repository. This plugin eliminates the need for manual Parcel installation or configuration, providing a 'batteries included' approach by bundling essential Parcel plugins such as `parcel-plugin-at-alias`, `parcel-plugin-codegen`, `parcel-plugin-externals`, and `parcel-plugin-import-maps`. While it offers a streamlined development experience for Piral projects using Parcel v1, users should be aware of its reliance on the older Parcel version, which has different features and behavior compared to Parcel v2. Its primary differentiator is seamless integration with `piral-cli`, offering an alternative bundling solution alongside other options like Webpack or ESBuild within the Piral framework.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/smapiot/piral-cli-parcel","tags":["javascript","piral-cli","piral","plugin","parcel","build","debug","bundle","typescript"],"install":[{"cmd":"npm install piral-cli-parcel","lang":"bash","label":"npm"},{"cmd":"yarn add piral-cli-parcel","lang":"bash","label":"yarn"},{"cmd":"pnpm add piral-cli-parcel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a plugin for piral-cli and extends its functionality. piral-cli must be installed to utilize piral-cli-parcel.","package":"piral-cli","optional":false}],"imports":[],"quickstart":{"code":"import { execSync } from 'child_process';\nimport path from 'path';\n\n// This quickstart demonstrates how piral-cli-parcel enables Parcel v1 bundling\n// for Piral CLI commands by installing it into a new Piral instance.\n\nconst projectName = 'my-parcel-app';\nconst projectDir = path.join(process.cwd(), projectName);\n\ntry {\n  // Ensure piral-cli is installed globally (recommended for Piral development)\n  console.log('Installing piral-cli globally...');\n  execSync('npm install -g piral-cli@latest', { stdio: 'inherit' });\n\n  // Create a new Piral instance project\n  console.log(`\\nCreating Piral instance: ${projectName}`);\n  execSync(`piral new ${projectName} --template default --npm`, { stdio: 'inherit' });\n  process.chdir(projectDir); // Change to the newly created project directory\n\n  // Install piral-cli-parcel as a development dependency.\n  // The presence of this package automatically configures `piral-cli` to use Parcel v1.\n  console.log('\\nInstalling piral-cli-parcel into the project...');\n  execSync('npm install piral-cli-parcel --save-dev', { stdio: 'inherit' });\n\n  console.log('\\nConfiguration complete. Piral CLI commands will now use Parcel v1.');\n  console.log('To start debugging your Piral instance: run `piral debug` from this directory.');\n  console.log('To build your Piral instance for production: run `piral build` from this directory.');\n\n  // Demonstrating a build command that completes quickly\n  console.log('\\nExecuting a Piral build command (using Parcel v1) to demonstrate functionality...');\n  execSync('piral build --target release', { stdio: 'inherit' });\n  console.log('\\nBuild completed using Parcel v1. Check the `dist/release` directory.');\n\n  console.log(`\\nQuickstart finished. To clean up, run: rm -rf ${projectName}`);\n\n} catch (error) {\n  console.error('An error occurred during the quickstart setup or execution:', error);\n} finally {\n  process.chdir(process.cwd()); // Return to the original directory\n}\n","lang":"typescript","description":"This script demonstrates installing `piral-cli-parcel` into a new Piral instance project and verifies that Piral CLI commands like `piral build` now utilize Parcel v1 as the underlying bundler."},"warnings":[{"fix":"If Parcel v2 or another bundler is required, consider using `piral-cli-webpack` or `piral-cli-esbuild` with custom configurations.","message":"This plugin is specifically built for and relies on Parcel v1. Users expecting Parcel v2 features, bug fixes, or a more modern bundling experience may find limitations. Parcel v1 is no longer actively maintained by the Parcel team.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always install `piral-cli-parcel` in the `devDependencies` of your Piral or pilet project's `package.json`.","message":"The `piral-cli-parcel` plugin must be explicitly installed as a development dependency (`npm i piral-cli-parcel --save-dev`) within a Piral instance or pilet project for `piral-cli` to detect and use Parcel as the bundler. A global Parcel installation is not sufficient.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure you are installing `piral-cli-parcel` via npm and not relying on any direct file paths from a previous monorepo setup.","message":"As of v0.15.0, the `piral-cli-parcel` package was moved to a dedicated repository. While this is generally transparent for npm installations, it could affect users who previously relied on internal paths or specific monorepo structures for direct imports or tooling integrations.","severity":"breaking","affected_versions":">=0.15.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Run `npm install piral-cli-parcel --save-dev` in the root of your Piral instance or pilet project to install the Parcel bundler plugin.","cause":"The `piral-cli` could not detect an installed bundler plugin (like `piral-cli-parcel`) in the project's `devDependencies`.","error":"No bundler found for the current project."},{"fix":"Ensure 'some-external-package' is correctly listed in your `package.json` `dependencies` (for the Piral instance or pilet). If it's a shared Pilet external, verify it's correctly declared and provided by the Piral instance. For complex resolution issues, review Parcel v1's documentation regarding externals or consider explicit aliases.","cause":"Parcel v1's module resolution, especially for external dependencies in Piral, might fail to locate a required package.","error":"Parcel build failed: Cannot find module 'some-external-package'"}],"ecosystem":"npm"}