Sitemap

BabylonJS Typescript Project

Get started with BabylonJS in HTML

--

Project structure

Press enter or click to view image in full size

Instructions

  • Create Index.html inside public directory.
  • Create style.css inside public directory.
  • Create app.ts inside src directory, which is project’s starter file.
  • Add webpack to you project by creating webpack.config.js in root directory.

Specify project entry, bundle output, resolvers, plugins, and dev server.

  • Add typescript config by creating tsconfig.json in root directory.

    Get Eduard Jacobs’s stories in your inbox

    Join Medium for free to get updates from this writer.

  • Scripts to build and run project. Add scripts to package.json in root.
  • Install dependencies. Make sure you have package.json in root directory.

— Babylon

npm install --save-dev @babylonjs/core @babylonjs/inspector

— Typescript

npm install --save-dev typescript ts-loader

— Webpack

npm install --save-dev webpack webpack-cli webpack-dev-server html-   webpack-plugin
  • At this point you will have package.json that looks like this.
  • Now you can build and start the project

Build

npm run build

Start

npm run start

--

--