I have a simple Persona.ts class
class Persona {
nombre: string;
constructor(message: string) {
this.nombre = message;
}
sayHi() {
return "Hello, " + this.nombre;
}
}
let persona = new Persona("world");
let button = document.createElement('button');
button.textContent = "Say Hello";
button.onclick = function() {
let persona = new Persona("world");
alert(persona.sayHi());
}
document.body.appendChild(button);
And in the gulpfile.js I have this.
var gulp = require('gulp');
let ts = require('gulp-typescript');
gulp.task('transpile', () => {
return gulp.src('ts/*.ts')
.pipe(ts())
.pipe(gulp.dest('js'));
});
when I run gulp transpile I get this output:
[21:33:17] Using gulpfile ~\Documents\Prueba\gulpfile.js
[21:33:17] Starting 'transpile'...
[21:33:18] Finished 'transpile' after 271 ms
However in the folder of the project, there are NO JS libraries with js files generated.
via Luis Valencia - MVP
No comments:
Post a Comment