A webpack plugin to integrate Fractal (a component library / styleguide tool) into a webpack build workflow. Current stable version is 4.1.7. It supports webpack 4 and 5, and Fractal 1.x. The plugin can either start a development server or build a static styleguide during webpack compilation. Key differentiators include simple configuration via a Fractal config file, seamless integration with webpack, and support for both server and build modes. Release cadence is irregular; last release was in 2023. Requires Node.js 10+.
npm install fractal-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Demonstrates typical webpack config with FractalWebpackPlugin in build mode, using default config path.
Remove the 'browsersync' option from the plugin options and configure browsersync in your fractal.config.js if needed.
Rename your fractal config file to 'fractal.config.js' or set the configPath option explicitly.
Upgrade webpack to version 4 or 5.
Use CommonJS require() or ensure your bundler handles CJS interop.
Use const FractalWebpackPlugin = require('fractal-webpack-plugin');Ensure the fractal config file exists at the specified path. Since v4.1.3, the default is 'fractal.config.js'.
Set mode to 'server' or 'build'.