Update version handling and comments in options.js

This commit is contained in:
Jürg Lehni 2014-08-16 18:49:35 +02:00
parent bcd3fe2493
commit 21c9f97450
2 changed files with 16 additions and 11 deletions

View file

@ -33,7 +33,7 @@ OPTIONS=$(printf '%q' $(node -e "
process.stdout.write(JSON.stringify(__options)); process.stdout.write(JSON.stringify(__options));
")) "))
# Build the prepo.js command out of it, passing on version and date as defines: # Build the prepo.js command out of it, passing on version and date as defines:
COMMAND="../node_modules/.bin/prepro -o $OPTIONS -o '{ \"date\": \"$DATE\", \"stats\": false }' $3 $2" COMMAND="../node_modules/.bin/prepro -o $OPTIONS -o '{ \"date\": \"$DATE\" }' $3 $2"
case $1 in case $1 in
commented) commented)

View file

@ -10,25 +10,30 @@
* All rights reserved. * All rights reserved.
*/ */
// Define default options for browser based compile-time preprocessing. // Define __options for code preprocessing when building the library, as well as
// These are also used for building, but some values are overridden // browser based compile-time preprocessing when loading the separate source
// (e.g. version, stats). // files directly through load.js / prepro.js during development.
// The paper.js version.
// NOTE: Adjust value here before calling publish.sh, which then updates and
// publishes the various JSON package files automatically.
var version = '0.9.19';
var inBrowser = typeof window === 'object';
var __options = { var __options = {
parser: 'acorn', // If this file is loaded in the browser, we're in dev mode through load.js
version: '0.9.19', version: inBrowser ? 'dev' : version,
environment: 'browser', environment: 'browser',
parser: 'acorn',
legacy: true, legacy: true,
stats: true,
svg: true, svg: true,
fatlineClipping: true, fatlineClipping: true,
booleanOperations: true, booleanOperations: true,
nativeContains: false, nativeContains: false,
paperScript: true, paperScript: true,
palette: true, palette: true,
// Only load stats when in dev mode
stats: inBrowser,
debug: false debug: false
}; };
// If this file is loaded in the browser, we're in dev mode through load.js
if (typeof window === 'object')
__options.version = 'dev';