Make load.sh work for Node.js too

This commit is contained in:
Jürg Lehni 2013-06-27 14:41:25 -07:00
parent 041586fa01
commit fdfdf96357
2 changed files with 13 additions and 4 deletions

View file

@ -10,11 +10,19 @@
#
# All rights reserved.
# This script simply copies src/load.js to dist/paper.js to, which loads the
# library from separate sources through PrePro.
# This script simply copies src/load.js to dist/paper.js and dist/paper-node.js,
# which loads the library from separate sources through PrePro both in the
# browser and in Node.js.
if [ -f ../dist/paper.js ]
then
rm ../dist/paper.js
fi
if [ -f ../dist/paper-node.js ]
then
rm ../dist/paper-node.js
fi
cp ../src/load.js ../dist/paper.js
cp ../src/load.js ../dist/paper-node.js

View file

@ -39,7 +39,8 @@ if (typeof window !== 'undefined') {
// Node based loading through PrePro:
var prepro = require('prepro/lib/node.js');
// Include deafult browser options.
prepro.include('options.js');
// Step out and back into src in case this is loaded from dist/paper-node.js
prepro.include('../src/options.js');
// Override node specific options.
prepro.setOptions({
browser: false,
@ -47,5 +48,5 @@ if (typeof window !== 'undefined') {
stats: false
});
// Load Paper.js library files.
prepro.include('paper.js');
prepro.include('../src/paper.js');
}