我正在试图让我的.NET Core Angular 2应用程序在构建时忽略文件。这是我的systemjs.config.js:
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': '../lib/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'ng2-translate': 'npm:ng2-translate/bundles/ng2-translate.umd.js',
'ng2-sharebuttons': 'npm:ng2-sharebuttons',
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
'/app': {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
'ng2-translate': {
defaultExtension: 'js'
},
'ng2-sharebuttons': {
defaultExtension: 'js'
}
}
});
})(this);
添加包含许多.d.ts文件的ng2-sharebuttons后,每当我尝试构建解决方案时,都会遇到与某些.d.ts文件相关的构建错误。虽然@angular文件夹中有许多.d.ts文件,但它们不会导致任何错误。我已经尝试过其他几个外部库,但它们对我来说都有同样的问题。
这是我的tsconfig:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"node_modules",
"wwwroot/lib"
]
}
我尝试从Visual Studio中的解决方案中排除文件夹并隐藏文件夹,但是根本找不到库。有人可以提供建议吗?我是否需要为任何外部库添加输入法?