Explorar o código

updates to build process
now including .d.ts file

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
71c0cffad6
Modificáronse 3 ficheiros con 18 adicións e 11 borrados
  1. 5 2
      gui/package.json
  2. 2 2
      gui/tsconfig.json
  3. 11 7
      gui/webpack.config.js

+ 5 - 2
gui/package.json

@@ -25,11 +25,14 @@
         "@types/node": "^10.5.2",
         "ts-loader": "^4.0.0",
         "typescript": "^2.9.2",
-        "webpack": "^4.15.1",
+        "webpack": "^4.16.0",
         "webpack-cli": "^3.0.8",
         "webpack-dev-server": "^3.1.4"
     },
     "peerDependencies": {
         "babylonjs": ">3.2.0"
+    },
+    "dependencies": {
+        "dts-bundle-webpack": "^1.0.0"
     }
-}
+}

+ 2 - 2
gui/tsconfig.json

@@ -20,12 +20,12 @@
         "skipDefaultLibCheck": true,
         "skipLibCheck": true,
         "baseUrl": "./src/",
-        "rootDir": "./",
+        "rootDir": "./src/",
         "paths": {
             "babylonjs": [
                 "../../dist/preview release/babylon.d.ts"
             ]
         },
-        "outDir": "./dist/build"
+        "outDir": "./build"
     }
 }

+ 11 - 7
gui/webpack.config.js

@@ -1,5 +1,6 @@
 const path = require('path');
 const webpack = require('webpack');
+const DtsBundleWebpack = require('dts-bundle-webpack')
 
 module.exports = {
     entry: {
@@ -28,12 +29,6 @@ module.exports = {
             amd: "babylonjs"
         }
     },
-    plugins: [
-        // fixing a small issue when root is an array and not a string
-        /*new webpack.SourceMapDevToolPlugin({
-            filename: '[name].js.map',
-        })*/
-    ],
     devtool: "source-map",
     module: {
         rules: [{
@@ -54,6 +49,15 @@ module.exports = {
         compress: false,
         //open: true,
         port: 9000
-    }
+    },
+    plugins: [
+        new DtsBundleWebpack({
+            name: "babylonjs-gui",
+            main: path.resolve(__dirname, './dist/build/index.d.ts'),
+            out: path.resolve(__dirname, './dist/index.d.ts'),
+            baseDir: path.resolve(__dirname, './dist/build/'),
+            headerText: "BabylonJS GUI"
+        })
+    ]
 }
 //]