A simple copy-webpack-plugin.
npm install copy-webpack --save-dev// example: webpack.config.mjs
import { CopyWebpack } from 'copy-webpack';
export default {
plugins: [new CopyWebpack('static')]
};Glob or path from where we copy files.
string object [string|object]
- new CopyWebpackPlugin({
- patterns: [
- {
- from: 'static',
- globOptions: {
- dot: true,
- ignore: ['.gitkeep']
- }
- }
- ]
- });
+ new CopyWebpack('static');- new CopyWebpackPlugin({
- patterns: [
- {
- from: 'extra',
- noErrorOnMissing: true,
- globOptions: {
- dot: true,
- ignore: ['.gitkeep']
- }
- }
- ]
- });
+ new CopyWebpack([
+ {
+ from: 'extra',
+ noErrorOnMissing: true
+ }
+ ]);