每天都要开心哦~~~

今天来个双语文档

先来说一下npm 执行的方式

1.首先,进入项目目录,下载依赖,添加到dev依赖

1.First, Go to your application project, Install copyfiles dependency with the below command Note: please add this as devDependencies using –save-dev

npm install --save-dev copyfiles

2.把下面代码放到你的package.json,就像下图那个样子

2.In the package.json file, There is a script tag, add below line of code

"scripts": {
"copy": "copyfiles source destination"
}

3.最后,我们可以用npm run copy命令进行拷贝文件操作啦~~

3.Finally, You can script by calling npm run copy command in terminal

4.npm copyfiles examples

4.自定义拷贝案例

  • 来看一些案例吧~discuss some examples
  • 拷贝文件到某个目录Copy specific files into directory
  • 假如你的js文件放在src/assets,你怎么只拷贝里面的JS文件到另一个目录呢?
  • Suppose you have a javascript file in src/assets folder. How do you copy only javascript files to the output directory
"copyjavascript": "copyfiles src/assets/*.js destination"
  • 尝试一下下面的命令,感受一下吧~~
npx copyfiles dist test
npx copyfiles dist/spa/assets/*.js out
npx copyfiles dist/spa/* out
npx copyfiles dist/spa/* test
npx copyfiles dist/spa test
npx copyfiles dist/spa test -a
npx copyfiles -a dist/spa test
npx copyfiles -a dist/spa/assets/* test

接下来说一下我们使用node命令执行脚本命令的方式

  • 创建scripts\copy.js
  • 编写代码
const copyfiles = require('copyfiles');

const copyEnd = () => {
console.log('我拷贝完啦~~~');
};
// 这个命令是针对根目录的哦
copyfiles(['dist/spa/assets/*.js', 'out'], { all: true }, copyEnd);
  • 运行代码
node scripts/copy.js

  • 今天就写到这里啦~小伙伴们,( ̄ω ̄( ̄ω ̄〃 ( ̄ω ̄〃)ゝ我们明天再见啦~~
  • 大家要天天()哦

欢迎大家指出文章需要改正之处~

学无止境,合作共赢

欢迎路过的小哥哥小姐姐们提出更好的意见哇~~

最新文章

  1. POJ 3669 Meteor Shower【BFS】
  2. web前端基础知识-(三)JavaScript基本操作
  3. IO复用三种方式
  4. 微信小程序-视图模板
  5. Websocket 协议解析
  6. jquery取消选择select下拉框
  7. 【转载】VC维的来龙去脉
  8. html5 video标签兼容性与自定义控件
  9. JSON和js对象之间的相互转化
  10. 被废弃的 Thread.stop, Thread.suspend, Thread.resume 和Runtime.runFinalizersOnExit
  11. JIRA 6.0.1 (ZIP Archive)最新破解方法,绝对可用
  12. Selenium来抓取动态加载的页面
  13. nodejs 教程
  14. css简单实现五角星评分、点赞收藏、展示评分(半颗星、1/3颗星)
  15. word中表格第一列序号的设置
  16. [APIO 2016]Gap
  17. cmd是命令提示符吗?
  18. javaWeb锁屏的简单实现
  19. LearnOpenGL学习笔记(一)——现有代码理解
  20. 兼容IE8及以上的常用css选择器

热门文章

  1. Redis 02: redis基础知识 + 5种数据结构 + 基础操作命令
  2. python关于Django搭建简单博客项目(教程)
  3. GlusterFS常用维护操作命令
  4. 手记系列之二 ----- 关于IDEA的一些使用方法经验
  5. jdk线程池ThreadPoolExecutor工作原理解析(自己动手实现线程池)(一)
  6. C++ 中指针常量、指向常量的指针、引用类型的常量
  7. WPF之XAML
  8. Go语言核心36讲41
  9. php变量规范命名用了记得消除,保证唯一性
  10. Kubernetes基础_Service暴露的两种方式