A Webpack plugin to create symbolic links for emitted files. Current stable version is 1.1.0 (released in 2022). The plugin runs after Webpack's emit phase (by default) to create symlinks from one built file to another. It supports array configuration for multiple symlinks, a force option to create missing directories, and a hook option to specify the exact compiler hook (e.g., entryOption). Designed for static site deployments where a single-file router (like index.html) must also appear under a different name (e.g., 200.html). Works with Webpack 4 and 5. Maintained but low churn.
npm install symlink-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Configures SymlinkWebpackPlugin to create a symlink from 'index.html' to '200.html' after Webpack emits files.
Upgrade Webpack to version 4 or later. If stuck on older Webpack, use v0.2.0 (last version supporting Webpack 2/3).
Explicitly set 'hook' option to the desired compiler hook (e.g., 'thisCompilation', 'emit', 'afterProcessAssets').
Set 'force: true' to create missing directories, or ensure the directory structure exists before the build.
No immediate action required; the dependency is stable. Future versions might drop fs-extra.
Run npm install --save-dev symlink-webpack-plugin or yarn add --dev symlink-webpack-plugin.
Use const SymlinkWebpackPlugin = require('symlink-webpack-plugin'); then new SymlinkWebpackPlugin(...).Ensure each configuration object has 'origin' and 'symlink' as strings. For multiple symlinks, pass an array of objects.