浏览代码

fixing viewer build

Raanan Weber 7 年之前
父节点
当前提交
9e2ad61390
共有 5 个文件被更改,包括 12 次插入10 次删除
  1. 3 2
      Tools/Gulp/config.json
  2. 5 4
      Tools/Gulp/gulpfile.js
  3. 2 2
      Tools/Publisher/index.js
  4. 1 1
      Viewer/tsconfig-gulp.json
  5. 1 1
      Viewer/tsconfig.json

+ 3 - 2
Tools/Gulp/config.json

@@ -1870,10 +1870,11 @@
         ],
         ],
         "build": {
         "build": {
             "srcOutputDirectory": "../../Viewer/",
             "srcOutputDirectory": "../../Viewer/",
+            "distOutputDirectory": "/viewer/",
             "dtsBundle": {
             "dtsBundle": {
                 "name": "babylonjs-viewer",
                 "name": "babylonjs-viewer",
-                "main": "../../Viewer/dist/build/src/index.d.ts",
-                "out": "../../../../dist/preview release/viewer/babylon.viewer.module.d.ts",
+                "main": "../../dist/preview release/viewer/build/src/index.d.ts",
+                "out": "../../babylon.viewer.module.d.ts",
                 "prependText": "/// <reference path=\"./babylon.d.ts\"/>\n/// <reference path=\"./babylon.glTF2Interface.d.ts\"/>\n/// <reference path=\"./babylonjs.loaders.d.ts\"/>\ndeclare module \"babylonjs-loaders\"{ export=BABYLON;}\n"
                 "prependText": "/// <reference path=\"./babylon.d.ts\"/>\n/// <reference path=\"./babylon.glTF2Interface.d.ts\"/>\n/// <reference path=\"./babylonjs.loaders.d.ts\"/>\ndeclare module \"babylonjs-loaders\"{ export=BABYLON;}\n"
             },
             },
             "processDeclaration": {
             "processDeclaration": {

+ 5 - 4
Tools/Gulp/gulpfile.js

@@ -458,7 +458,7 @@ var buildExternalLibrary = function (library, settings, watch) {
                             if (isdts) this.push(file);
                             if (isdts) this.push(file);
                             cb();
                             cb();
                         }))
                         }))
-                        .pipe(gulp.dest('.'));
+                        .pipe(gulp.dest(outputDirectory));
                     // dts-bundle does NOT support (gulp) streams, so files have to be saved and reloaded, 
                     // dts-bundle does NOT support (gulp) streams, so files have to be saved and reloaded, 
                     // until I fix it
                     // until I fix it
                     event.on("end", function () {
                     event.on("end", function () {
@@ -528,9 +528,10 @@ var buildExternalLibrary = function (library, settings, watch) {
                 });
                 });
 
 
                 if (minifiedOutputs.length) {
                 if (minifiedOutputs.length) {
-                    //build = build
-                    //.pipe(uglify())
-                    //.pipe(optimisejs())
+                    console.log("minifying");
+                    build = build
+                        .pipe(uglify())
+                        .pipe(optimisejs())
                 }
                 }
 
 
                 minifiedOutputs.forEach(dest => {
                 minifiedOutputs.forEach(dest => {

+ 2 - 2
Tools/Publisher/index.js

@@ -56,7 +56,7 @@ let packages = [
     },
     },
     {
     {
         name: 'viewer-assets',
         name: 'viewer-assets',
-        path: basePath + '/../../Viewer/dist/build/assets/',
+        path: basePath + '/../../Viewer/build/assets/',
         required: [
         required: [
             basePath + '/../../Viewer/assets/readme.md',
             basePath + '/../../Viewer/assets/readme.md',
             basePath + '/../../Viewer/assets/package.json',
             basePath + '/../../Viewer/assets/package.json',
@@ -215,7 +215,7 @@ function processCore(package, version) {
 
 
 function processViewer(package, version) {
 function processViewer(package, version) {
 
 
-    let buildPath = package.path + "dist/build/src/";
+    let buildPath = package.path + "build/src/";
     let projectPath = '../../Viewer';
     let projectPath = '../../Viewer';
 
 
     if (package.required) {
     if (package.required) {

+ 1 - 1
Viewer/tsconfig-gulp.json

@@ -41,7 +41,7 @@
                 "./assets/"
                 "./assets/"
             ]
             ]
         },
         },
-        "outDir": "./dist/build"
+        "outDir": "./build"
     },
     },
     "exclude": [
     "exclude": [
         "node_modules",
         "node_modules",

+ 1 - 1
Viewer/tsconfig.json

@@ -44,6 +44,6 @@
                 "./assets/*"
                 "./assets/*"
             ]
             ]
         },
         },
-        "outDir": "./dist/build"
+        "outDir": "./build"
     }
     }
 }
 }