当然我们在编译过程中不会一直输入同样的命令,此时 NPM 给我们提供了很多脚本命令功能
创建编译脚本
{ "name": "angular2-starter", "version": "0.1.0", "scripts": { "build": "tsc --rootDir src --outDir dist" }, "dependencies": { }, "devDependencies": { } }
运行以下命令即可完成编译
npm run build
创建 postinstall
我们可以通过 postinstall
来完成 typing 的自动安装。
{ "name": "angular2-starter", "version": "0.1.0", "scripts": { "build": "tsc --rootDir src --outDir dist", "postinstall": "typings install" }, "dependencies": { }, "devDependencies": { } }
这样一来,我们通过 npm install
就可以安装项目的所有依赖,包括 typings 模块。
DEMO 源码
〖坚强的一俢〗
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦