1.1.2 • Published 7 years ago

@easy-webpack/config-copy-files v1.1.2

Weekly downloads
303
License
MIT
Repository
github
Last release
7 years ago

@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.