@a.gusev/symlink-webpack-plugin

1.0.2 • Public • Published

Symlink Webpack Plugin

Webpack plugin for creating a symbolic link in any directory before compilation. This can be useful for code reuse without creating an npm package.

Installation

npm i -D @a.gusev/symlink-webpack-plugin

Usage

In your webpack config:

const SymlinkWebpackPlugin = require('@a.gusev/symlink-webpack-plugin');

module.exports = {
  // ...etc
  plugins: [
    new SymlinkWebpackPlugin({
      targetAbsolutePrefix: path.resolve(__dirname, "../common"), // default: output.path
      pathAbsolutePrefix: __dirname, // default: output.path
      paths: [
        "src/css",
        "src/js/styles",
        "src/js/themes",
        "src/js/utils",
        ".babelrc",
        ".browserslistrc",
        ".eslintrc.json"
      ]
    })
  ]
};

This setting makes symbolic link <pathAbsolutePrefix>/src/css to <targetAbsolutePrefix>/src/css and etc.

Readme

Keywords

Package Sidebar

Install

npm i @a.gusev/symlink-webpack-plugin

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

3.7 kB

Total Files

4

Last publish

Collaborators

  • a.gusev