Question about using Babylon with webpack and Typescript

Specifically BABYLON.SceneLoader.Append(). I have my gltf file and materials in a sub directory. Should the sub directory be located under the /src or /dist subdir? Will the compiler update the paths for me?

well you do what you want actually. It is all based on your own webpack config file

const path = require("path");

module.exports = {
  mode: "development",
  entry: {
    app: "./src/app.ts",
  },
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "[name].js",
  },
  resolve: {
    extensions: [".ts", "tsx", ".js"],
  },
  devtool: "source-map",
  plugins: [],
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        loader: "ts-loader",
        exclude: /node_modules/,
      },
    ],
  },
};

To follow up, copy-webpack-plugin did the trick for me. Now I keep all my *.gltf and texture files in a subdir and when it gets compiled its all copied to the same subdir under /dist

I like using loaders, but the copy plugin will work as well for sure :slight_smile: Glad you could find a solution