2016-11-02 142 views
0

我同時使用部署在.gulp .netCore咕嘟咕嘟誤差angular2

的package.json

"dependencies": { 
    "@angular/common": "~2.1.0", 
    "@angular/compiler": "~2.1.0", 
    "@angular/core": "~2.1.0", 
    "@angular/forms": "~2.1.0", 
    "@angular/http": "~2.1.0", 
    "@angular/platform-browser": "~2.1.0", 
    "@angular/platform-browser-dynamic": "~2.1.0", 
    "@angular/router": "~3.1.0", 
    "@angular/upgrade": "~2.1.0", 
    "@angular/angular-in-memory-web-api": "~0.1.5", 
    "@angular/angular-cli": "1.0.0-beta.19-3". 
    ... } 

咕嘟咕嘟錯誤消息

[13:58:40] ReferenceError: options is not defined 
at Gulp.<anonymous> ("-"\Gulpfile.js:65:18) 
at module.exports ("-"\node_modules\orchestrator\lib\runTask.js:34:7) 
at Gulp.Orchestrator._runTask ("-"\node_modules\orchestrator\index.js:273:3) 
at Gulp.Orchestrator._runStep ("-"\node_modules\orchestrator\index.js:214:10) 
at "-"\node_modules\orchestrator\index.js:279:18 
at finish ("-"\node_modules\orchestrator\lib\runTask.js:21:8) 
at "-"\node_modules\orchestrator\lib\runTask.js:52:4 
at f ("-"\node_modules\end-of-stream\node_modules\once\once.js:17:25) 
at Transform.onend ("-"\node_modules\end-of-stream\index.js:31:18) 
at emitNone (events.js:91:20) 
at Transform.emit (events.js:185:7) 
at "-"\node_modules\gulp-clean\node_modules\readable-stream\lib\_stream_readable.js:965:16 
at _combinedTickCallback (internal/process/next_tick.js:67:7) 
at process._tickCallback (internal/process/next_tick.js:98:9) 

角項目搜索關於後有錯誤這個問題,它似乎與angular-cli ticket的角度cli有關。這張票據說它是從beta15開始修復的,因此我添加了最新的angular-cli版本beta.19-3。然而,gulp仍然顯示這個錯誤,我不確定是否需要以不同的方式引用angular-cli來使其工作。我使用gp_uglify和gp_uglify_harmony嘗試了兩種不同的方法。但是我仍然有同樣的錯誤。

gulpfile.js(任務)

gulp.task('app', ['app_clean'], function (cb) { 
    pump([ 
     gulp.src(srcPaths.app), 
     gp_sourcemaps.init(), 
     gp_typescript(require('./tsconfig.json').compilerOptions), 
     //gp_uglify({ mangle: false }), 
     minifier(options, gp_uglify_harmony), 
     gp_sourcemaps.write('/'), 
     gulp.dest(destPaths.app) 
    ], 
    cb 
    ); 
}); 

似乎有些選項不見了,我也覺得這些職位,是指約一個懶惰的選擇,但我被困在路上,我應該使用它$ Is not defined scripts Gulp taskgulp-load-plugins not loading plugins

編輯。添加的最後2個鏈接

回答

0

如果有人有類似的問題,最好的辦法是使用記錄,這往往會引導問題

// Compile, minify and create sourcemaps all TypeScript files 
// and place them to wwwroot/app, together with their js.map files. 
gulp.task('app', ['app_clean'], function (cb) { 
    pump([ 
     gulp.src(srcPaths.app), 
     gp_sourcemaps.init(), 
     gp_typescript(require('./tsconfig.json').compilerOptions), 
     gp_uglify({mangle:false}).on('error', gutil.log), 
     gp_sourcemaps.write('/'), 
     gulp.dest(destPaths.app) 
    ], 
    cb 
    ); 
}); 
的根