Make inclusion of PaperScript optional and build a core version of the library without it.

This commit is contained in:
Jürg Lehni 2013-06-24 04:49:45 -07:00
parent eef736f3d8
commit e6bed426d7
4 changed files with 5 additions and 0 deletions

View file

@ -31,4 +31,5 @@ then
fi
./preprocess.sh $MODE ../src/paper.js "-d '{ \"browser\": true }' -i '../src/constants.js'" ../dist/paper.js
./preprocess.sh $MODE ../src/paper.js "-d '{ \"browser\": true, \"paperscript\": false }' -i '../src/constants.js'" ../dist/paper-core.js
#./preprocess.sh $MODE ../src/paper.js "-d '{ \"node\": true }' -i '../src/constants.js'" ../dist/paper-node.js

View file

@ -13,3 +13,4 @@
# We need to keep dead_code around for now, since the very odd JavaScriptCore
# scope bug fix (nop().nop()) requires it.
uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unsafe=true,unused=false,dead_code=false,hoist_funs=false -m -r "_$_,$_" -b ascii_only=true,beautify=false --comments /^!/
uglifyjs ../dist/paper-core.js -o ../dist/paper-core-min.js -c unsafe=true,unused=false,dead_code=false,hoist_funs=false -m -b ascii_only=true,beautify=false --comments /^!/

View file

@ -20,5 +20,6 @@ var options = {
stats: true,
svg: true,
fatline: true,
paperscript: true,
debug: false
};

View file

@ -130,4 +130,6 @@ return paper;
// include PaperScript separately outside the main paper scope, due to its use
// of with(). This also simplifies making its inclusion optional.
/*#*/ if (options.paperscript) {
/*#*/ include('core/PaperScript.js');
/*#*/ } // options.paperscript