copyassets-webpack-plugin

0.0.3 • Public • Published

copyassets-webpack-plugin

Webpack plugin that copies over compiled assets to additional folders. Useful in cases where compiled assets need to exist multiple places such as when assets, but you don't want to create multiple entry points which would cause additional compilations.

Usage

var path = require('path');
var webpack = require('webpack');
var CopyAssetsPlugin = require('copyassets-webpack-plugin');
 
var outputPath = __dirname;
var additionalOutputPath = path.join(__dirname, 'subfolder');
var yetAnotherOutputPath = path.join(__dirname, 'diffent-subfolder');
 
module.exports = {
  entry: {
    'index': 'index.js'
  },
  output: {
    path: outputPath,
    filename: '[name].bundle.js'
  },
  plugins: [
    new webpack.NoErrorsPlugin(),
    new CopyAssetsPlugin([ additionalOutputPath, yetAnotherOutputPath ])
  ],
  stats: {
    colors: true
  }
};
 

Todo

  • Filter which files are copied
  • Move some files rather than copy

Contributions

Issues and Pull Requests are welcome.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i copyassets-webpack-plugin

    Weekly Downloads

    1

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • drouillard