【发布时间】:2018-01-06 21:24:35
【问题描述】:
我想从我的结果包中排除导入的库。 假设我们有下一个代码:
import * as angular from 'angular';
const app = angular.module('app',[]);
我们有这个构建任务。
function buildTs(compileOptions) {
browserify(compileOptions)
.plugin(tsify, tsconfig.compileOptions)
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest(path.dest.js));
}
构建完成后,Angular 库将包含在 bundle.js 中。 我可以避免这种情况吗?
我的 tsConfig:
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"noImplicitAny": false,
"removeComments": true,
"sourceMap": true,
"types": [
"angular",
"angular-cookies",
"angular-ui-bootstrap",
"angular-ui-router",
"jasmine",
"angular-mocks"
]
},
"include": [
"app"
],
"exclude": [
"node_modules"
]
}
从类型中删除类型没有帮助:)
【问题讨论】:
-
您好,
angular和angularjs标签不同。我要求请删除任何一个不必要的标签。标签angular用于 Angular 2/4(严格),angularjs用于 Angular 1.x。谢谢
标签: angularjs typescript gulp