Skip to content

Building

Andrew McPherson edited this page Mar 5, 2016 · 2 revisions

Building

Usage

node build

Will build from source. It starts with the indexes, like "./source/index.js", and compiles together any and all dependencies (and all dependencies of those dependencies). To declare a dependency in JS, use require(), or in CSS, use @import. If an error is found in any of the sources, the build is aborted, and the error is reported. When the build is done, the files are put in the "./build/web" directory.

node build server

Will build from source and host the build at localhost:13821. The sources are compiled as detailed in node build. If, after that, any of the sources are changed, the script will automatically rebuild them, and automatically refresh the build that the server is hosting.

node build bundle

Will build from source and bundle them into executables. The executables support Windows, Mac, and Linux. The executables also include an inlined webpage, or web1, which can be run in Chrome, Firefox, Opera, and Safari.

node build --STAGE

Will build from source for a specific stage, like --development or --production. If neither is specified, the stage defaults to development. A variable named STAGE is injected into the code, which will return either PRODUCTION or DEVELOPMENT. During a production build, the sources are minified and uglified and concatenated.

Implementation

Contributing

If you want to contribute to the script, check out our gist!

Clone this wiki locally