diff --git a/build/load.sh b/build/load.sh index 7c7a37ad..d04fb1b9 100755 --- a/build/load.sh +++ b/build/load.sh @@ -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 diff --git a/src/load.js b/src/load.js index 2a6d111a..e8ce2548 100644 --- a/src/load.js +++ b/src/load.js @@ -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'); }