Browse Source

compile according to the right namespaces

Raanan Weber 7 năm trước cách đây
mục cha
commit
fda4f75d22
2 tập tin đã thay đổi với 25 bổ sung9 xóa
  1. 2 1
      gui/package.json
  2. 23 8
      gui/webpack.config.js

+ 2 - 1
gui/package.json

@@ -22,6 +22,7 @@
     },
     "homepage": "https://github.com/BabylonJS/Babylon.js#readme",
     "devDependencies": {
+        "@types/node": "^10.5.2",
         "ts-loader": "^4.0.0",
         "typescript": "^2.9.2",
         "webpack": "^4.15.1",
@@ -31,4 +32,4 @@
     "peerDependencies": {
         "babylonjs": ">3.2.0"
     }
-}
+}

+ 23 - 8
gui/webpack.config.js

@@ -19,25 +19,40 @@ module.exports = {
         devtoolModuleFilenameTemplate: '[relative-resource-path]'
     },
     resolve: {
-        extensions: [".js", '.ts'],
-        /*alias: {
-            "babylonjs": __dirname + '/../dist/preview release/babylon.max.js'
-        }*/
+        extensions: [".js", '.ts']
     },
     externals: {
-        babylonjs: true
+        babylonjs: {
+            root: "BABYLON",
+            commonjs: "babylonjs",
+            commonjs2: "babylonjs",
+            amd: "babylonjs"
+        }
     },
     plugins: [
         new webpack.WatchIgnorePlugin([
             /\.d\.ts$/
         ]),
         // fixing a small issue when root is an array and not a string
-        new webpack.SourceMapDevToolPlugin({
+        /*new webpack.SourceMapDevToolPlugin({
             namespace: "BABYLON.GUI"
-        })
+        })*/
     ],
     module: {
-        rules: [{ test: /\.tsx?$/, loader: "ts-loader", exclude: /node_modules/ }]
+        rules: [
+            {
+                test: /\.tsx?$/,
+                loader: "ts-loader",
+                exclude: /node_modules/
+            },
+            {
+                test: /\.fx$/,
+                use: [
+                    {
+                        loader: path.resolve('../Tools/WebpackShaderLoader/index.js')
+                    }
+                ]
+            }]
     },
     mode: "development",
     devServer: {