Skip to content

Webpack plugin for copying compiled assets to additional directories

License

Notifications You must be signed in to change notification settings

drouillard/copyassets-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Webpack plugin for copying compiled assets to additional directories

Resources

License

Stars

Watchers

Forks

Packages

No packages published