npm link & run npm script

https://blog.csdn.net/juhaotian/article/details/78672390

npm link命令可以将一个任意位置的npm包链接到全局执行环境,从而在任意位置使用命令行都可以直接运行该npm包。

app-cmd.cmd


#!/usr/bin/env node echo "666" && npm run app

package.json


{
"scripts": {
"app": "npm run rmrf-all && webpack -p",
"dev": "npm run rmrf && webpack -p -w",
"prod": "webpack -p",
"rmrf": "rimraf build/js && rimraf build/css",
"rmrf-all": "rimraf build/*",
"page": "cd modules && browser-sync start --server --files './*.html'",
"index": "cd build && browser-sync start --server --files './index.html'",
"test": "cd src && browser-sync start --server --files './*.*'"
},
"private": true,
"bin": {
"app": "app-shell",
"cmd": "app-cmd"
},
}

npm

https://docs.npmjs.com/cli/link

https://docs.npmjs.com/cli/run-script

https://docs.npmjs.com/misc/scripts


symbolic link

https://en.wikipedia.org/wiki/Symbolic_link


npm link

https://docs.npmjs.com/cli/link

https://segmentfault.com/a/1190000016208716#articleHeader2


npm link & run npm script的更多相关文章

  1. 使用npm link 加速调试

    我们在把包发布到npm上时,如果需要对本地的包进行修改,我们需要改变一个版本,重新发布.然后测试时需要更新这个包进行测试.这样的话,每一次的调试都特别麻烦.我们可以使用npm link来加速这个调试过 ...

  2. npm link的作用

    语法: 1. 在一个包目录下npm link (把当前的包目录软连接到global folder里面,把二进制文件也软连接到global的bin里面  这个prefix可以用npm config ls ...

  3. [Node.js] Using npm link to use node modules that are "in progress"

    It is some times convenient, even necessary, to make use of a module that you are working on before ...

  4. 使用npm link 创建本地模块

    1. npm link 介绍 创建一个全局的符号链接,优点是方便我们进行本地node模块的开发调用,和后期发布私服,或者npm 仓库调用是一致的 以下为官方的说明: First, npm link i ...

  5. [NPM] Test npm packages locally in another project using npm link

    We will import our newly published package into a new project locally to make sure everything is wor ...

  6. 未解决:found 1 high severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details

    问题出现: 在通过 `ng new hello-world` 命令新建项目时,项目出现以下警告: found high severity vulnerability run `npm audit fi ...

  7. npm link 安装本地模块,将本地模块cli化

    第三方学习地址 http://mp.weixin.qq.com/s?__biz=MzAxMTU0NTc4Nw==&mid=2661157390&idx=1&sn=6d96e54 ...

  8. [已解决]This dependency was not found: * common/stylus/index.styl in ./src/main.js To install it, you can run: npm install --save common/stylus/index.styl

    出现 This dependency was not found: * common/stylus/index.styl in ./src/main.js To install it, you can ...

  9. npm link & unlink

    npm link & unlink https://dev.to/erinbush/npm-linking-and-unlinking-2h1g

随机推荐

  1. 使用ImageList组件制作动画图片

    实现效果: 知识运用: Timer组件的Enabled属性  Tick事件 PictureBox控件的Image属性 ImageList组件的Images属性 实现代码: private void F ...

  2. CORS的原理及应用

    CORS的原理及应用 CORS是跨站资源共享,同样是解决浏览器的同源策略 其本质是设置响应头,使得浏览器允许跨域请求. 第三方网站返回数据的时候在浏览器的响应头中添加允许的域名,允许所有的用* 1 简 ...

  3. IntelliJ IDEA java设置程序运行时内存

    Run/Edit Configurations   Configuration/VM options  例如:设置运行内存为:-Xmx3m -Xms3m

  4. C11 C语言文件的读写

    目录 文件的打开和关闭 字符流读写文件 文件的打开和关闭 fopen( ) fopen( ) 函数来创建一个新的文件或者打开一个已有的文件,这个调用会初始化类型 FILE 的一个对象,类型 FILE ...

  5. DROP OPERATOR CLASS - 删除一个操作符类

    SYNOPSIS DROP OPERATOR CLASS name USING index_method [ CASCADE | RESTRICT ] DESCRIPTION 描述 DROP OPER ...

  6. axios的post请求方法---以Vue示例

    Axios向后端提交数据的参数格式是json,而并非用的是form传参,post表单请求提交时,使用的Content-Type是application/x-www-form-urlencoded,而使 ...

  7. const,static,extern,#define

    一.const // 简单定义变量,可以修改变量的值 ; a = ; // const的用法 // 用法一: ; ; // 不允许修改,因为 const 修饰 b/c,指定 b/c 为常量!! // ...

  8. C#与SQLServer数据库连接

    第一种连接数据库方法:直接通过数据库的用户名.密码等连接 步骤: (1)建立SqlConnection对象,指定SqlConnection对象的ConnectionString属性: (2)打开数据库 ...

  9. 洛谷 2387/BZOJ 3669 魔法森林

    3669: [Noi2014]魔法森林 Time Limit: 30 Sec  Memory Limit: 512 MBSubmit: 3765  Solved: 2402[Submit][Statu ...

  10. pandas关联mysql并读写数据库

    1.代码读写mysql,必须安装关联mysql的工具 操作如下命令: sudo apt-get install mysql-server mysql-clientsudo apt-get instal ...