【发布时间】:2016-07-18 08:36:53
【问题描述】:
我正在尝试仅使用 npm 创建构建脚本,而无需 grunt 或 gulp。
除了连接打字稿之外,大多数事情都在工作。
我可以编译单个 typescript 文件,但我有许多单独的文件需要连接然后编译。
我正在使用 concat-cli mobule,但它似乎没有连接文件,只是输出文件夹中的第一个文件。
连接打字稿文件的最佳方法是什么。
{
"name": "starter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"scss": "node-sass --output-style compressed -o src/assets/css src/assets/sass/main.scss",
"compile:ts": "tsc --outDir ./src/assets/js/ --module commonjs ./src/app/**/*.ts",
"concat:ts": "concat-cli --files src/app/**/*.ts --output dist/js/output.ts",
"serve": "browser-sync start --server --files 'src/assets/css/, src/assets/js/*.js, **/*.html, !node_modules/**/*.html'",
"watch:css": "onchange 'src/assets/sass/*.scss' -- npm run scss",
"watch:js": "onchange 'src/app/**/*.js' -- npm run jshint",
"watch:ts": "onchange 'src/app/**/*.ts' -- npm run concat:ts",
"watch:all": "npm-run-all -p serve watch:css watch:js watch:images",
},
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.13.0",
"concat": "0.0.1-security",
"concat-cli": "^4.0.0",
"node-sass": "^3.8.0",
"onchange": "^2.5.0",
"typescript": "^1.8.10",
}
}
【问题讨论】:
标签: typescript npm