Skip to content

A Webpack configuration for copying files from one location to another using the "Copy Webpack Plugin"

License

Notifications You must be signed in to change notification settings

easy-webpack/config-copy-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@easy-webpack/config-copy-files

Copy files to build directory using Copy webpack plugin.

Installation

npm install --save-dev @easy-webpack/config-copy-files

easy-webpack is also required.

Usage

// webpack.config.js
const generateConfig = require('@easy-webpack/core').generateConfig;

const baseConfig = { ... }; // project-specific config like the entry file

module.exports = generateConfig(
  baseConfig,

  require('@easy-webpack/config-copy-files')
    ([
      /* Array of patterns object */
      { from: 'favicon.ico' },
      { from: 'robots.txt' },
      { from: 'src/locals', to: 'locals' }
    ], {
      /* Options object */
      copyUnmodified: true
    })
);

Patterns object is identical to pattern properties in copy webpack plugin.

Options object is identical to options in copy webpack plugin.

Note: this config will NOT modify context options in webpack config. Therefore all from paths are relative to the webpack.config.js file.

About

A Webpack configuration for copying files from one location to another using the "Copy Webpack Plugin"

Resources

License

Stars

Watchers

Forks

Packages

No packages published