Skip to content

Instantly share code, notes, and snippets.

@casr
Last active October 5, 2017 10:36
Show Gist options
  • Save casr/454a59e13cf1c1f031a47a4d9b3e9b79 to your computer and use it in GitHub Desktop.
Save casr/454a59e13cf1c1f031a47a4d9b3e9b79 to your computer and use it in GitHub Desktop.
# In a new terminal and follow these steps
# First let's get the version of Node and NPM we are working with:
npm -v
node -v
# Next create a minimal testing area
mkdir -p pixi-test
cd pixi-test
echo {} >package.json
npm install -D -E browserify budo
npm install -S -E pixi.js
# Check our versions
cat package.json
# Next modify our PATH so that we use local npm packages i.e.
# so that you don't have to preceed the following commands with
# ./node_modules/.bin/browserify or ./node_modules/.bin/budo
export PATH=$(npm bin):$PATH
# Create our minimal file
echo "var PIXI = require('pixi.js')\nvar app = new PIXI.Application()\ndocument.body.appendChild(app.view)\n" >browser.js
# Check it looks correct
cat browser.js
# Budo handles the browserify bundling step, makes a minimal index.html and
# launches a web server for you
budo browser.js
# Open the address given to you by budo. If everything worked then you should see a black rectangle
# Some sample output for comparison...
❯ npm -v
3.10.10
❯ node -v
v6.11.3
❯ mkdir -p pixi-test
❯ cd pixi-test
❯ echo {} >package.json
❯ npm install -D -E browserify budo
❯ npm install -S -E pixi.js
❯ cat package.json
{
"dependencies": {
"pixi.js": "4.5.6"
},
"devDependencies": {
"browserify": "14.4.0",
"budo": "10.0.4"
}
}
❯ export PATH=$(npm bin):$PATH
❯ echo "var PIXI = require('pixi.js')\nvar app = new PIXI.Application()\ndocument.body.appendChild(app.view)\n" >browser.js
❯ cat browser.js
var PIXI = require('pixi.js')
var app = new PIXI.Application()
document.body.appendChild(app.view)
❯ budo browser.js
[0000] info Server running at http://192.168.1.100:9966/ (connect)
[0001] 1160ms 3.4MB (browserify)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment