Bläddra i källkod

Updating gulpfile for sourcemaps

Now generating sourcemaps correctly.
I believe gulp should be totally changed (declaration can be piped
parallel to "to-js") And the scripts doesn't need the entire list, it
should be enough to simply add all of the *.js files after generating
them.
Raanan Weber 10 år sedan
förälder
incheckning
d39c96ef07
1 ändrade filer med 10 tillägg och 6 borttagningar
  1. 10 6
      Tools/Gulp/gulpfile.js

+ 10 - 6
Tools/Gulp/gulpfile.js

@@ -24,16 +24,20 @@ gulp.task('shaders', function() {
  */
  */
 gulp.task('typescript-to-js', function() {
 gulp.task('typescript-to-js', function() {
   //Compile all ts file into their respective js file.
   //Compile all ts file into their respective js file.
-  return gulp.src(['../../Babylon/**/*.ts','../../References/**/*.d.ts'])
-	.pipe(sourcemaps.init())
-    .pipe(typescript({ noExternalResolve: true, target: 'ES5'}))
-    .pipe(gulp.dest('../../Babylon/'));
+  
+  var tsResult = gulp.src(['../../Babylon/**/*.ts','../../References/**/*.d.ts'])
+                       .pipe(sourcemaps.init()) // This means sourcemaps will be generated
+                       .pipe(typescript({ noExternalResolve: true, target: 'ES5'}));
+  
+   return tsResult.js
+                .pipe(sourcemaps.write('.')) // Now the sourcemaps are added to the .js file
+                .pipe(gulp.dest('../../Babylon/'));
 });
 });
 
 
 /**
 /**
  * Compile the declaration file babylon.d.ts
  * Compile the declaration file babylon.d.ts
  */
  */
-gulp.task('typescript-declaration', function() {
+gulp.task('typescript-declaration', ['typescript-to-js'], function() {
 	
 	
 	var tsResult = gulp.src(['../../Babylon/**/*.ts','../../References/**/*.d.ts'])
 	var tsResult = gulp.src(['../../Babylon/**/*.ts','../../References/**/*.d.ts'])
                        .pipe(typescript({
                        .pipe(typescript({
@@ -209,7 +213,7 @@ gulp.task('default', function() {
 /**
 /**
  * The defaut typescript task, call the tasks: shaders, scripts, clean AFTER the task typescript-to-js
  * The defaut typescript task, call the tasks: shaders, scripts, clean AFTER the task typescript-to-js
  */
  */
-gulp.task('typescript', ['typescript-to-js', 'typescript-declaration'], function() {
+gulp.task('typescript', ['typescript-declaration'], function() {
     gulp.start('shaders','scripts', 'clean');
     gulp.start('shaders','scripts', 'clean');
 });
 });