下面的gulp重命名任務適用於帶有一個點的angularjs2 ts文件,如appcomponent.ts。但是,如果文件名有兩個點,例如login.service.ts,則gulp extname會很困惑,並且會在第一個點之後作爲擴展名。任何想法如何讓extname知道擴展是在最後一個點之後?有兩個點的Angularjs2文件的gulp extname
gulp.task('ts', function() {
return gulp.src('src/**/*.ts')
.pipe(rename({
extname: ''
}))
.pipe(traceur({
modules: 'instantiate',
moduleName: true,
annotations: true,
types: true,
memberVariables: true
}))
.pipe(rename({
extname: '.js'
}))
.pipe(gulp.dest('build'));
});
如果這個問題是關於Angular2的話,它不應該有[tag:angularjs]標籤。 –