Angular2=>Angular 5.2 in visual studio 2015 更新后启动非常慢
Angular2=>Angular 5.2 in visual studio 2015 very slow launch after update
我已经从 angular2 升级了我的 angular2 项目 =>
Angular 5.2
我正在使用 visual studio 2015 和 asp.net 项目。
升级后启动 F5 非常慢 90 秒,低于更新前的 30 秒。
有人遇到同样的问题吗?
我已经清除了很多依赖项以减少噪音。
所以package.json是这样的:
{
"name": "",
"version": "2.0.0",
"author": "",
"description": "",
"dependencies": {
"@angular/animations": "5.2.0",
"@angular/common": "5.2.0",
"@angular/compiler": "5.2.0",
"@angular/core": "5.2.0",
"@angular/forms": "5.2.0",
"@angular/http": "5.2.0",
"@angular/platform-browser": "5.2.0",
"@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0",
"@types/node": "^10.12.12",
"bootstrap": "3.3.7",
"core-js": "2.4.1",
"ngx-toastr": "6.5.0",
"reflect-metadata": "0.1.12",
"rxjs": "5.5.2",
"systemjs": "0.19.47",
"zone.js": "0.8.26"
},
"devDependencies": {
"typescript": "2.6.2"
}
}
main.ts 像这样
// main entry point
//import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
//enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
Systemjs.config 像这样
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.min.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.min.js',
'@angular/core': 'npm:@angular/core/bundles/core.umd.min.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.min.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.min.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.min.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.min.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.min.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.min.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.min.js',
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.min.js',
// other libraries
'rxjs': 'npm:rxjs',
'ngx-toastr': 'node_modules/ngx-toastr/toastr.umd.js'
},
// 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'
}
}
});
})(this);
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipDefaultLibCheck": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"../node_modules/@types"
],
"lib": [ "es5", "es6", "dom" ]
//"outFile": "dist/app.js"
},
"exclude": ["node_modules/@angular/platform-server/src/transfer_state.d.ts", "bin", "node_modules" ]
}
感谢您的帮助
F
我将 ide 升级到 vs 2017,一切都变得像以前一样。
谢谢。
我关闭主题
我已经从 angular2 升级了我的 angular2 项目 => Angular 5.2 我正在使用 visual studio 2015 和 asp.net 项目。 升级后启动 F5 非常慢 90 秒,低于更新前的 30 秒。
有人遇到同样的问题吗?
我已经清除了很多依赖项以减少噪音。
所以package.json是这样的:
{
"name": "",
"version": "2.0.0",
"author": "",
"description": "",
"dependencies": {
"@angular/animations": "5.2.0",
"@angular/common": "5.2.0",
"@angular/compiler": "5.2.0",
"@angular/core": "5.2.0",
"@angular/forms": "5.2.0",
"@angular/http": "5.2.0",
"@angular/platform-browser": "5.2.0",
"@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0",
"@types/node": "^10.12.12",
"bootstrap": "3.3.7",
"core-js": "2.4.1",
"ngx-toastr": "6.5.0",
"reflect-metadata": "0.1.12",
"rxjs": "5.5.2",
"systemjs": "0.19.47",
"zone.js": "0.8.26"
},
"devDependencies": {
"typescript": "2.6.2"
}
}
main.ts 像这样
// main entry point
//import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
//enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
Systemjs.config 像这样
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.min.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.min.js',
'@angular/core': 'npm:@angular/core/bundles/core.umd.min.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.min.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.min.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.min.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.min.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.min.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.min.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.min.js',
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.min.js',
// other libraries
'rxjs': 'npm:rxjs',
'ngx-toastr': 'node_modules/ngx-toastr/toastr.umd.js'
},
// 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'
}
}
});
})(this);
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipDefaultLibCheck": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"../node_modules/@types"
],
"lib": [ "es5", "es6", "dom" ]
//"outFile": "dist/app.js"
},
"exclude": ["node_modules/@angular/platform-server/src/transfer_state.d.ts", "bin", "node_modules" ]
}
感谢您的帮助
F
我将 ide 升级到 vs 2017,一切都变得像以前一样。 谢谢。 我关闭主题