GithubHelp home page GithubHelp logo

doc22940 / threejs-webpack-es6-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulmg/threejs-webpack-es6-boilerplate

0.0 1.0 0.0 3.86 MB

A basic boilerplate for a Three.js project compiled with Webpack and transpiled via Babel to enable using ES6 syntax.

License: MIT License

CSS 3.20% JavaScript 95.24% HTML 1.55%

threejs-webpack-es6-boilerplate's Introduction

Three.js Webpack ES6 Boilerplate

https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate/

A basic boilerplate for a Three.js project including the use of Webpack and ES6 syntax via Babel.

Project Structure

build - Directory for built and compressed files from the npm build script
src - Directory for all dev files
├── css - Contains all SCSS files, that are compiled to `src/public/css`
├── js - All the Three.js app files, with `app.js` as entry point. Compiled to `src/public/js` with webpack
│   ├── app
│   │   ├── components - Three.js components that get initialized in `main.js`
│   │   ├── helpers - Classes that provide ideas on how to set up and work with defaults
│   │   ├── managers - Manage complex tasks such as GUI or input
│   │   └── model - Classes that set up the model object
│   ├── data - Any data to be imported into app
│   └── utils - Various helpers and vendor classes
└── public - Used by webpack-dev-server to serve content. Webpack builds local dev files here. 
    └── assets - Is copied over to build folder with build command. Place external asset files here.

Getting started

Install dependencies:

npm install

Then run dev script:

npm run dev

Spins up a webpack dev server at localhost:8080 and keeps track of all js and sass changes to files.

Build

npm run build

Cleans existing build folder while linting js folder and copies over the public assets folder from src. Then sets environment to production and compiles js and css into build.

Other NPM Scripts

You can run any of these individually if you'd like with the npm run command:

  • prebuild - Cleans up build folder and lints src/js
  • clean - Cleans build folder
  • lint - Runs lint on the src/js folder and uses the .eslintrc file in root for linting rules
  • webpack-server - Start up a webpack-dev-server with hot-module-replacement
  • webpack-watch - Run webpack in dev environment with watch
  • dev:js - Run webpack in dev environment without watch
  • build:dir - Copy files and folders from src/public to build
  • build:js - Run webpack in production environment

Input Controls

  • Press H to hide dat.GUI
  • Arrow controls will pan
  • Mouse left click will rotate/right click will pan
  • Scroll wheel zooms in and out

threejs-webpack-es6-boilerplate's People

Contributors

igghera avatar lucaskuzma avatar paulmg avatar rtpharry avatar weiserhei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.