Selaa lähdekoodia

Revert "Make d.ts file a module so that it can be imported"

David Catuhe 9 vuotta sitten
vanhempi
commit
c3a288c9d3
3 muutettua tiedostoa jossa 1 lisäystä ja 32 poistoa
  1. 0 29
      Tools/Gulp/gulp-addDtsExport.js
  2. 1 1
      Tools/Gulp/gulp-addModuleExports.js
  3. 0 2
      Tools/Gulp/gulpfile.js

+ 0 - 29
Tools/Gulp/gulp-addDtsExport.js

@@ -1,29 +0,0 @@
-var gutil = require('gulp-util');
-var through = require('through2');
-
-module.exports = function (varName) {
-    return through.obj(function (file, enc, cb) {
-
-        var moduleExportsAddition = '\nexport = ' + varName + ';\n';
-
-        if (file.isNull()) {
-            cb(null, file);
-            return;
-        }
-
-        if (file.isStream()) {
-            //streams not supported, no need for now.
-            return;
-        }
-
-        try {
-            file.contents = new Buffer(String(file.contents) + moduleExportsAddition);
-            this.push(file);
-
-        } catch (err) {
-            this.emit('error', new gutil.PluginError('gulp-add-module-exports', err, { fileName: file.path }));
-        }
-        cb();
-    });
-};
-

+ 1 - 1
Tools/Gulp/gulp-addModuleExports.js

@@ -36,7 +36,7 @@ module.exports = function (varName) {
         }
 
         try {
-            file.contents = new Buffer(decorateAddition + extendsAddition + String(file.contents) + moduleExportsAddition);
+            file.contents = new Buffer(decorateAddition.concat(new Buffer(extendsAddition.concat(String(file.contents)).concat(moduleExportsAddition))));
             this.push(file);
 
         } catch (err) {

+ 0 - 2
Tools/Gulp/gulpfile.js

@@ -3,7 +3,6 @@ var uglify = require("gulp-uglify");
 var typescript = require("gulp-typescript");
 var sourcemaps = require("gulp-sourcemaps");
 var srcToVariable = require("gulp-content-to-variable");
-var addDtsExport = require("./gulp-addDtsExport");
 var addModuleExports = require("./gulp-addModuleExports");
 var merge2 = require("merge2");
 var concat = require("gulp-concat");
@@ -99,7 +98,6 @@ gulp.task('typescript-compile', function () {
     return merge2([
         tsResult.dts
             .pipe(concat(config.build.declarationFilename))
-            .pipe(addDtsExport("BABYLON"))
             .pipe(gulp.dest(config.build.outputDirectory)),
         tsResult.js
             .pipe(gulp.dest(config.build.srcOutputDirectory))