webpack-copy-bundle
v0.9.0
Published
Webpack plugin to copy your bundle after a successful build.
Downloads
343
Readme
Webpack Copy Bundle Plugin
Webpack plugin to copy your bundle after a successful build.
In some cases you might want to copy your bundle to a directory after a successful build. However, Webpack does not allow you to do these 'out-of-source' builds. You can use the standard Webpack Copy Plugin, however then you need to manually copy all related files (bundle, source-map, etc.). To make this a bit easier you can use the Webpack Copy Bundle Plugin
Using this plugin you can give a list of bundles to copy and where to copy them to. The plugin takes care of copying all of the related files to the output directory.
Installation
npm install webpack-copy-bundle --save-dev
Usage
const WebpackCopyBundle = require('./src');
module.exports = {
entry: './src/index.js',
plugins: [
new WebpackCopyBundle({
main: '../example/folder',
})
]
};
Example of multiple entries:
const WebpackCopyBundle = require('./src');
module.exports = {
entry: {
main: './src/index.js',
worker: './src/worker.js'
},
plugins: [
new WebpackCopyBundle({
main: '../example/folder',
worker: '../example/folder/worker',
})
]
};