Registry / devops / pilet-webpack-plugin

pilet-webpack-plugin

JSON →
library1.2.0jsnpmunverified

Webpack plugin for generating a valid pilet bundle as part of the Piral ecosystem. Current stable version 1.2.0 (released 2024) requires Node >=16 and webpack 4.x (peer dep). This plugin is the standard way to bundle pilets with Webpack v4. Unlike generic webpack configs, it sets up the specific output format, externals, and variable injection needed for pilets to work with a Piral shell. Ships TypeScript types. Part of the piral-cli toolchain; single repository was split from piral-cli-webpack. Older v0.x versions work with piral-core 0.15.

npm install pilet-webpack-plugin
INSTALL
IMPORT
SIG · PILET-WEBPACK-PLUG
P
pilet-webpack-plugin
devopsjavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PiletWebpackPlugin
import { PiletWebpackPlugin } from 'pilet-webpack-plugin'
const PiletWebpackPlugin = require('pilet-webpack-plugin')
Named export, not default. CJS require({}) also fine; ESM available.
PiletWebpackPlugin
const { PiletWebpackPlugin } = require('pilet-webpack-plugin')
const PiletWebpackPlugin = require('pilet-webpack-plugin').default
CommonJS destructure works; no default export exists.
PiletWebpackPluginOptions
import type { PiletWebpackPluginOptions } from 'pilet-webpack-plugin'
Type export available for TypeScript users.

Shows how to add the PiletWebpackPlugin to a webpack 4 config with required options 'name', 'version', 'piral' and optional 'variables'.

const { PiletWebpackPlugin } = require('pilet-webpack-plugin'); const piletPkg = require('./package.json'); module.exports = { plugins: [ new PiletWebpackPlugin({ name: piletPkg.name, version: piletPkg.version, piral: piletPkg.piral.name, variables: { PIRAL_CLI_VERSION: require('piral-cli/package.json').version, }, }), ], };
Debug
Known issues
breakingWebpack 5 is NOT supported. Plugin only works with webpack 4.x peer dependency.
fix
Use pilet-webpack-plugin only with webpack 4. For webpack 5, use piral-cli-webpack5 or piral-cli-vite.
affects: >=1.0.0
gotchaThe 'piral' option expects the name of the Piral instance (e.g., 'my-app-shell'), not the piral-cli package name.
fix
Set piral: piletPkg.piral.name from your pilet's package.json, which references the Piral shell name.
affects: >=0.15.0
gotchaThe plugin defines global variables via DefinePlugin. If you already use DefinePlugin, ensure no conflicts.
fix
Use the 'variables' option to inject additional defines; avoid duplicates.
affects: >=0.15.0
deprecatedOlder v0.x releases used a different API and output format. Migrate to v1.x for Piral 1.0 compatibility.
fix
Update to pilet-webpack-plugin@1 and adjust options (name, version, piral).
affects: <1.0.0
Errors
Common errors & fixes
Error: 'piral' is required
The piral option was not provided or is empty.
fix
Add piral: 'your-piral-instance-name' to the plugin options.
TypeError: webpack version 5.x is not supported
Using the plugin with webpack 5 instead of webpack 4.
fix
Downgrade to webpack@4 or use a different bundler plugin like piral-cli-webpack5.
Module not found: Can't resolve 'piral-core'
The pilet's peer dependency on piral-core is missing or incorrect.
fix
Add 'piral-core' as a dependency in your pilet's package.json with the correct version.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
webpackrequiredpeer dependency; plugin works with webpack 4.x only
Agent activity
2 hits · last 30 days
node
2
Resources
pilet-webpack-plugin — npm install pilet-webpack-plugin · libregistry