create-symlink-webpack-plugin

1.0.1 • Public • Published

How it works

webpack 4 plugin to generate symlinks

Usage

const CreateSymlinkPlugin = require('create-symlink-webpack-plugin');
module.exports = {
    plugins: [
        new CreateSymlinkPlugin([
            {
                origin: 'index-[hash].html',
                symlink: '200.html',
            },
        ])
    ]
}

All paths are relative to your webpack output.path

You can pass in either an object, or an array of objects. there is also an optional force parameter, that will caused it to create the symlink even if the destination file doesn't exist:

const CreateSymlinkPlugin = require('create-symlink-webpack-plugin');
module.exports = {
    plugins: [
        new CreateSymlinkPlugin([
            {
                origin: 'index-[hash].html',
                symlink: '200.html',
            },
            true
        ])
    ]
}

Options

  • origin path to the original file or directory
  • symlink path for the symlink

These are both relative to your webpack output.path

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i create-symlink-webpack-plugin

    Weekly Downloads

    481

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    76.6 kB

    Total Files

    7

    Last publish

    Collaborators

    • khalwat