项目作者: ferdikoomen

项目描述 :
Webpack plugin to copy your bundle after a successful build.
高级语言: JavaScript
项目地址: git://github.com/ferdikoomen/webpack-copy-bundle.git
创建时间: 2019-10-08T07:08:00Z
项目社区:https://github.com/ferdikoomen/webpack-copy-bundle

开源协议:MIT License

下载


Webpack Copy Bundle Plugin

NPM
License
Coverage
Downloads
Build

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

  1. npm install webpack-copy-bundle --save-dev

Usage

  1. const WebpackCopyBundle = require('./src');
  2. module.exports = {
  3. entry: './src/index.js',
  4. plugins: [
  5. new WebpackCopyBundle({
  6. main: '../example/folder',
  7. })
  8. ]
  9. };

Example of multiple entries:

  1. const WebpackCopyBundle = require('./src');
  2. module.exports = {
  3. entry: {
  4. main: './src/index.js',
  5. worker: './src/worker.js'
  6. },
  7. plugins: [
  8. new WebpackCopyBundle({
  9. main: '../example/folder',
  10. worker: '../example/folder/worker',
  11. })
  12. ]
  13. };