summaryrefslogtreecommitdiff
path: root/web-ui/config
diff options
context:
space:
mode:
authorRoald de Vries <rdevries@thoughtworks.com>2016-12-05 17:13:13 +0100
committerRoald de Vries <rdevries@thoughtworks.com>2016-12-05 17:40:23 +0100
commit3303510d3dabc4c1efdf39c52db026229d909490 (patch)
tree452e4f87848f954722223e3271fb49638ce837ec /web-ui/config
parent84c065cd49a3aa133b591354d8851f5da22a170f (diff)
no difference between dev and prod static files
Diffstat (limited to 'web-ui/config')
-rw-r--r--web-ui/config/buildoptions.js2
-rw-r--r--web-ui/config/compass.rb8
-rw-r--r--web-ui/config/imagemin.js4
-rw-r--r--web-ui/config/minify_app.sh34
-rw-r--r--web-ui/config/package.sh54
5 files changed, 42 insertions, 60 deletions
diff --git a/web-ui/config/buildoptions.js b/web-ui/config/buildoptions.js
index 2e7ba028..b0fade0d 100644
--- a/web-ui/config/buildoptions.js
+++ b/web-ui/config/buildoptions.js
@@ -16,7 +16,7 @@
*/
({
- baseUrl: '../public',
+ baseUrl: '../public', /* TODO: double check: src or public? */
wrap: true,
almond: true,
optimize: 'none',
diff --git a/web-ui/config/compass.rb b/web-ui/config/compass.rb
index bc0301a3..461bd9e2 100644
--- a/web-ui/config/compass.rb
+++ b/web-ui/config/compass.rb
@@ -17,13 +17,11 @@
# Set this to the root of your project when deployed:
-target_dir = ENV['PIXELATED_BUILD'] == 'package' ? 'dist' : 'public'
-
-
http_path = "/"
-css_dir = "#{target_dir}/css"
+css_dir = "public/css"
sass_dir = "public/scss"
-images_dir = "public/images"
+images_dir = "src/images"
+generated_images_dir = "public/images"
javascripts_dir = "public/js"
# You can select your preferred output style here (can be overridden via the command line):
diff --git a/web-ui/config/imagemin.js b/web-ui/config/imagemin.js
index bbc589a8..6f94373e 100644
--- a/web-ui/config/imagemin.js
+++ b/web-ui/config/imagemin.js
@@ -17,8 +17,8 @@
const imagemin = require('imagemin');
-imagemin(['public/images/*.{gif,jpg,png,svg}'],
- 'dist/images'
+imagemin(['src/images/*.{gif,jpg,png,svg}'],
+ 'public/images'
).then(files => {
console.log('Images list:')
files.map(function(file) { console.log(file.path); });
diff --git a/web-ui/config/minify_app.sh b/web-ui/config/minify_app.sh
new file mode 100644
index 00000000..d9e232a5
--- /dev/null
+++ b/web-ui/config/minify_app.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Copyright (c) 2014 ThoughtWorks, Inc.
+#
+# Pixelated is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Pixelated is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+# concat js files and minify for app.min.js
+cat \
+public/bower_components/modernizr/modernizr.js \
+public/bower_components/lodash/dist/lodash.js \
+public/bower_components/jquery/dist/jquery.js \
+public/bower_components/jquery-ui/jquery-ui.js \
+public/bower_components/jquery-file-upload/js/jquery.fileupload.js \
+public/js/lib/highlightRegex.js \
+public/bower_components/handlebars/handlebars.js \
+public/bower_components/typeahead.js/dist/typeahead.bundle.js \
+public/bower_components/foundation/js/foundation.js \
+public/bower_components/foundation/js/foundation/foundation.reveal.js \
+public/bower_components/foundation/js/foundation/foundation.offcanvas.js \
+public/js/foundation/initialize_foundation.js \
+public/bower_components/iframe-resizer/js/iframeResizer.js \
+.tmp/app.concatenated.js | node_modules/.bin/minify --js > public/app.min.js
diff --git a/web-ui/config/package.sh b/web-ui/config/package.sh
index d4208ecb..06351257 100644
--- a/web-ui/config/package.sh
+++ b/web-ui/config/package.sh
@@ -18,61 +18,11 @@
set -e
-export PIXELATED_BUILD='package'
-
-mkdir -p dist
-
# initial npm tasks
-./go clean
-./go compass
-./go handlebars
-./go imagemin
-./go minify_html
-./go minify_sandbox
-./go add_git_version
-./go buildmain
-
+./go build
-# copy files
-cd public
-cp --parents \
-404.html \
-fonts/* \
-locales/**/* \
-bower_components/font-awesome/css/font-awesome.min.css \
-bower_components/jquery-file-upload/css/jquery.fileupload.css \
-bower_components/font-awesome/fonts/* \
-../dist
-cd -
-
-# concat js files and minify for app.min.js
-cat \
-public/bower_components/modernizr/modernizr.js \
-public/bower_components/lodash/dist/lodash.js \
-public/bower_components/jquery/dist/jquery.js \
-public/bower_components/jquery-ui/jquery-ui.js \
-public/bower_components/jquery-file-upload/js/jquery.fileupload.js \
-public/js/lib/highlightRegex.js \
-public/bower_components/handlebars/handlebars.js \
-public/bower_components/typeahead.js/dist/typeahead.bundle.js \
-public/bower_components/foundation/js/foundation.js \
-public/bower_components/foundation/js/foundation/foundation.reveal.js \
-public/bower_components/foundation/js/foundation/foundation.offcanvas.js \
-public/js/foundation/initialize_foundation.js \
-public/bower_components/iframe-resizer/js/iframeResizer.js \
-.tmp/app.concatenated.js > dist/app.js
-node_modules/.bin/minify dist/app.js > dist/app.min.js
-rm dist/app.js
-
-if [ ! -s dist/app.min.js ]
+if [ ! -s public/app.min.js ]
then
echo "Minification failed!"
exit 1;
fi
-
-# concat js files and minify for sandbox.min.js
-cat \
-public/js/sandbox.js \
-public/bower_components/iframe-resizer/js/iframeResizer.contentWindow.js > dist/sandbox.js
-node_modules/.bin/minify dist/sandbox.js > dist/sandbox.min.js
-rm dist/sandbox.js