playcanvas / playcanvas-webpack

Demonstration of building a PlayCanvas app with Webpack

Home Page:https://playcanvas.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PlayCanvas Webpack Template

There are lots of options for building a PlayCanvas app. One is to use Webpack, a popular JavaScript bundler.

This project doesn't load the PlayCanvas engine via a script tag. Instead, it imports the engine as an NPM package (see the repo's package.json file). The src/index.js script then imports the PlayCanvas (pc) API with the following statement:

import * as pc from 'playcanvas';

How to Build

Run:

npm install
npm run build

This will output the built PlayCanvas app to the dist folder.

How to Run

Run:

npm run dev

Open http://localhost:5000/ in your browser of choice. You should see a spinning cube:

About

Demonstration of building a PlayCanvas app with Webpack

https://playcanvas.com/

License:MIT License


Languages

Language:JavaScript 98.0%Language:CSS 2.0%