-
-
Save casr/454a59e13cf1c1f031a47a4d9b3e9b79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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