官网介绍

const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');module.exports = {context: path.join(__dirname, 'app'),devServer: {// This is required for older versions of webpack-dev-server// if you use absolute 'to' paths. The path should be an// absolute path to your build destination.outputPath: path.join(__dirname, 'build')},plugins: [new CopyWebpackPlugin([// {output}/file.txt{ from: 'from/file.txt' },// equivalent'from/file.txt',// {output}/to/file.txt{ from: 'from/file.txt', to: 'to/file.txt' },// {output}/to/directory/file.txt{ from: 'from/file.txt', to: 'to/directory' },// Copy directory contents to {output}/{ from: 'from/directory' },// Copy directory contents to {output}/to/directory/{ from: 'from/directory', to: 'to/directory' },// Copy glob results to /absolute/path/{ from: 'from/directory/**/*', to: '/absolute/path' },// Copy glob results (with dot files) to /absolute/path/{from: {glob:'from/directory/**/*',dot: true},to: '/absolute/path'},// Copy glob results, relative to context{context: 'from/directory',from: '**/*',to: '/absolute/path'},// {output}/file/without/extension{from: 'path/to/file.txt',to: 'file/without/extension',toType: 'file'},// {output}/directory/with/extension.ext/file.txt{from: 'path/to/file.txt',to: 'directory/with/extension.ext',toType: 'dir'}], {ignore: [// Doesn't copy any files with a txt extension    '*.txt',// Doesn't copy any file, even if they start with a dot'**/*',// Doesn't copy any file, except if they start with a dot{ glob: '**/*', dot: false }],// By default, we only copy modified files during// a watch or webpack-dev-server build. Setting this// to `true` copies all files.copyUnmodified: true})]
};

一 忽略后缀(测试.txt)

 ignore: [// Doesn't copy any files with a txt extension    '*.txt'],

注意是*.txt
二 忽略编辑器文件或特殊文件(.gitkeep)

  ignore: ['.*']

注意是.*


三 忽略文件夹static下的文件夹js里的所有内容

  ignore: ['js/**']

注意是'js/**'
如果希望忽略js里面的文件,即文件夹hh依旧copy

  ignore: ['js/*']

注意是'js/*'

CopyWebpackPlugin

CopyWebpackPlugin的ignore相关推荐

  1. vue-cli项目打包多个与static文件同级的静态资源目录(copy-webpack-plugin插件的使用)...

    场景 业务要求能够直接通过 "域名+/file"的方式访问静态资源的html,然而产品绝对static暴露在url中不好看又不能直接将html放在static中.所以想到了既然st ...

  2. @Ignore_JUnit - Ignore Test

    @Ignore 用法很简单, 如果你的测试用例还没有准备好而不想被执行, 又不想删掉或注释掉, 可以使用 @Ignore 标注来忽略测试. 方法一旦用 @Ignore 注解了将不会被执行. 如果一个类 ...

  3. Eclipse中SVN设置文件为ignore后重新添加至版本控制

    先前把需要版本控制的文件夹ignore了,用了很长时间找解决方法,结果发现竟如此简单,对eclipse的功能不熟悉啊. 方法如下: 在Window->Show View -> Naviga ...

  4. svn中的ignore

    首先,svn GUI菜单右键的ignore功能,写的模模糊糊,网上也没啥人给出清晰的解释,stackoverflow推荐用命令行控制 SVN有3中方法配置ignore 1.配置文件 C:\Users\ ...

  5. insert into与insert ignore以及replace into的区别

    insert ignore表示,如果表中已经存在相同的记录,则忽略当前新数据: INSERT INTO有无数据都插入,如果主键则不插入; REPLACE INTO 如果是主键插入则会替换以前的数据; ...

  6. MariaDB/MySQL防止重复插入相同记录:INSERT IGNORE或者REPLACE

    MySQL防止重复插入相同记录有2种常用的方法. 1 使用 INSERT IGNORE 使用 INSERT IGNORE 可以在插入具有相同主键的数据时不做重复插入. mysql> SELECT ...

  7. eclipse svn提交忽略文件及文件夹,ignore设置无效..

    如果之前提交过此文件,就不能设置忽略该文件了.所以第一次提交的时候要搞清楚再提交. [亲测,的确如此,用 Windows -> Preferences -> Team -> Igno ...

  8. warnings.filterwarnings(ignore)

    参考 https://blog.csdn.net/tefuirnever/article/details/94122670 在python中运行代码经常会遇到的情况是--代码可以正常运行但是会提示警告 ...

  9. mysql ignore index_mysql use index、ignore index、force index用法

    原创你去了哪里 最后发布于2019-10-18 14:05:48 阅读数 121  收藏 展开 1:use index:在你查询语句表名的后面,添加use index来提供你希望mysql去参考的索引 ...

最新文章

  1. JS中的this好神奇,都把我弄晕了
  2. oracle用户的追踪文件,Oracle中怎样通过触发器来追踪用户的活动?
  3. python在线朗读-Python带你朗读网页
  4. C# 中的字符串内插
  5. .net中 参数out,ref,params的区别
  6. 找Devcon.exe的同学看过来
  7. 原创的一份游戏创意案
  8. python银行系统-python实现简单银行管理系统
  9. 中国电信物联网平台入门学习笔记7:NB-IOT信号如何检测
  10. big类型和double类型
  11. 【转】Verilog算术右移
  12. 三个案例讲解Lambda表达式
  13. 超新星与暗能量的发现--今年诺贝尔物理奖工作的介绍(转)
  14. EfficientDet-BiFPN
  15. matlab cftool光滑曲线导出为什么就不光滑了_快速傅里叶变换(FFT)中为什么要“补零”?...
  16. chromium java_Chromium弹出Raspbian
  17. 2022年全球及中国场地电动车行业市场规模竞争格局研究预测及市场发展趋势分析预测
  18. 推荐一个mac文本文件夹文件的对比工具
  19. 软件发布中的不同版本
  20. cisp认证培训(cisp培训哪个机构更好)

热门文章

  1. 牛客练习赛51 C 勾股定理
  2. SOCKET的 10035错误
  3. vscode 舒服的颜色字体
  4. android最新版本6,keep安卓官方最新版
  5. “迷信”或是超前科学:朱清时谈量子
  6. 上海市建筑标准规范合集
  7. PhD Debate-8 | 迈向常识知识的高级语义理解
  8. 什么是僵死进程(Zombies)
  9. 巧用Excel 的vlookup()核验对比数据
  10. Java SE 基础(一)