mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Make load.sh work for Node.js too
This commit is contained in:
parent
041586fa01
commit
fdfdf96357
2 changed files with 13 additions and 4 deletions
|
@ -10,11 +10,19 @@
|
||||||
#
|
#
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
|
||||||
# This script simply copies src/load.js to dist/paper.js to, which loads the
|
# This script simply copies src/load.js to dist/paper.js and dist/paper-node.js,
|
||||||
# library from separate sources through PrePro.
|
# which loads the library from separate sources through PrePro both in the
|
||||||
|
# browser and in Node.js.
|
||||||
|
|
||||||
if [ -f ../dist/paper.js ]
|
if [ -f ../dist/paper.js ]
|
||||||
then
|
then
|
||||||
rm ../dist/paper.js
|
rm ../dist/paper.js
|
||||||
fi
|
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.js
|
||||||
|
cp ../src/load.js ../dist/paper-node.js
|
||||||
|
|
|
@ -39,7 +39,8 @@ if (typeof window !== 'undefined') {
|
||||||
// Node based loading through PrePro:
|
// Node based loading through PrePro:
|
||||||
var prepro = require('prepro/lib/node.js');
|
var prepro = require('prepro/lib/node.js');
|
||||||
// Include deafult browser options.
|
// 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.
|
// Override node specific options.
|
||||||
prepro.setOptions({
|
prepro.setOptions({
|
||||||
browser: false,
|
browser: false,
|
||||||
|
@ -47,5 +48,5 @@ if (typeof window !== 'undefined') {
|
||||||
stats: false
|
stats: false
|
||||||
});
|
});
|
||||||
// Load Paper.js library files.
|
// Load Paper.js library files.
|
||||||
prepro.include('paper.js');
|
prepro.include('../src/paper.js');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue