Piral CLI Webpack 5 Bundler Plugin

1.10.3 · active · verified Tue Apr 21

This package, `piral-cli-webpack5`, is a crucial plugin for the `piral-cli` toolchain, enabling developers to use Webpack version 5 for both debugging and production builds of micro-frontend applications (pilets) and their host applications (Piral instances). It provides the underlying bundling logic when `webpack5` is selected as the bundler within the Piral ecosystem. The package is currently at version 1.10.3 and is actively maintained, receiving frequent updates primarily focused on dependency upgrades, bug fixes, and compatibility improvements with newer versions of underlying frameworks like Angular. Releases appear to follow a regular cadence aligned with the broader Piral project, often weekly or bi-weekly for patch releases. Its key differentiator is its tight integration with the Piral CLI, abstracting away much of the complex Webpack 5 configuration needed for micro-frontends, allowing developers to focus on application logic rather than bundler specifics. It requires Node.js version 18.17 or higher.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to use the `piral-cli-webpack5` plugin implicitly through `piral-cli` commands for debugging and building pilets and Piral instances.

// First, ensure Piral CLI and the Webpack 5 bundler plugin are installed:
// npm install -g piral-cli
// npm install --save-dev piral-cli-webpack5

// To debug a pilet (micro-frontend) using Webpack 5:
// Navigate to your pilet's project directory.
console.log('Starting pilet in debug mode with Webpack 5...');
// This command automatically detects and uses 'piral-cli-webpack5' if it's installed.
// It launches a development server for the pilet.
piral debug --open --port 1234

// To build a pilet for production using Webpack 5:
// Navigate to your pilet's project directory.
console.log('Building pilet for production with Webpack 5...');
// This command leverages 'piral-cli-webpack5' to create a production-ready bundle.
// The output will typically be found in the 'dist' folder.
piral build --target es2019 --declaration

// To start a Piral instance (host application) for local development:
// Navigate to your Piral instance's project directory.
console.log('Starting Piral instance in debug mode, serving pilets with Webpack 5...');
piral debug --open --port 8080

// To build a Piral instance for production deployment:
// Navigate to your Piral instance's project directory.
console.log('Building Piral instance for production with Webpack 5...');
piral build --minify

view raw JSON →