mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Streamline build scripts and include minified version in dist.
This commit is contained in:
parent
89b8864b13
commit
110cbbb73d
6 changed files with 42 additions and 13 deletions
|
@ -17,9 +17,8 @@
|
|||
# build.sh MODE
|
||||
#
|
||||
# MODE:
|
||||
# commented Preprocessed but still formated and commented
|
||||
# stripped Formated but without comments (default)
|
||||
# compressed Uses UglifyJS to reduce file size
|
||||
# commented Preprocessed, still formated and commented
|
||||
# stripped Preprocessed, formated but without comments
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
echo "Building paper.js"
|
||||
./build.sh
|
||||
echo "Minifying paper.js"
|
||||
./minify.sh
|
||||
echo "Building docs"
|
||||
./docs.sh
|
||||
echo "Zipping paperjs.zip"
|
||||
|
|
17
build/minify-lib.sh
Executable file
17
build/minify-lib.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Paper.js
|
||||
#
|
||||
# This file is part of Paper.js, a JavaScript Vector Graphics Library,
|
||||
# based on Scriptographer.org and designed to be largely API compatible.
|
||||
# http://scriptographer.org/
|
||||
#
|
||||
# Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
||||
# http://lehni.org/ & http://jonathanpuckey.com/
|
||||
#
|
||||
# Distributed under the MIT license. See LICENSE file for details.
|
||||
#
|
||||
# All rights reserved.
|
||||
|
||||
uglifyjs ../lib/acorn.js -o ../lib/acorn-min.js -c -m -b ascii_only=true,beautify=false
|
||||
uglifyjs ../lib/esprima.js -o ../lib/esprima-min.js -c -m -b ascii_only=true,beautify=false
|
16
build/minify.sh
Executable file
16
build/minify.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Paper.js
|
||||
#
|
||||
# This file is part of Paper.js, a JavaScript Vector Graphics Library,
|
||||
# based on Scriptographer.org and designed to be largely API compatible.
|
||||
# http://scriptographer.org/
|
||||
#
|
||||
# Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
||||
# http://lehni.org/ & http://jonathanpuckey.com/
|
||||
#
|
||||
# Distributed under the MIT license. See LICENSE file for details.
|
||||
#
|
||||
# All rights reserved.
|
||||
|
||||
uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false --comments /^!/
|
|
@ -24,9 +24,8 @@
|
|||
# preprocess.sh MODE SOURCE DEFINITIONS PREPRO_INCLUDE DESTINATION
|
||||
#
|
||||
# MODE:
|
||||
# commented Preprocessed but still formated and commented
|
||||
# stripped Formated but without comments
|
||||
# compressed Uses UglifyJS to reduce file size
|
||||
# commented Preprocessed, still formated and commented
|
||||
# stripped Preprocessed, formated but without comments
|
||||
|
||||
VERSION=0.3
|
||||
DATE=$(git log -1 --pretty=format:%ad)
|
||||
|
@ -34,15 +33,10 @@ DATE=$(git log -1 --pretty=format:%ad)
|
|||
COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\" }' -d '$3' -i '$4' $2"
|
||||
|
||||
case $1 in
|
||||
stripped)
|
||||
eval "$COMMAND -c" > $5
|
||||
;;
|
||||
commented)
|
||||
eval $COMMAND > $5
|
||||
;;
|
||||
compressed)
|
||||
eval $COMMAND > temp.js
|
||||
uglifyjs temp.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false > $5
|
||||
rm temp.js
|
||||
stripped)
|
||||
eval "$COMMAND -c" > $5
|
||||
;;
|
||||
esac
|
||||
|
|
1
dist/.gitignore
vendored
1
dist/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
/paper-min.js
|
||||
/paper-server.js
|
||||
/serverdocs/
|
||||
/paperjs.zip
|
||||
|
|
Loading…
Reference in a new issue