Skip to content
Browse files

Modify css build to be dynamic.

Add tooltip plugin and print.css to build script.
  • Loading branch information...
1 parent 3c271f6 commit e7e53d2895259f87f5cb0cefc13a909b0eaf54aa @amasad amasad committed
Showing with 9 additions and 6 deletions.
  1. +6 −4 Cakefile
  2. +3 −2 index.html
View
10 Cakefile
@@ -4,7 +4,8 @@ fs = require 'fs'
coffee = require 'coffee-script'
INCLUDES = ['images', 'lib']
-LIBRARIES = ['lib/jqconsole-2.6.min.js']
+LIBRARIES = ['lib/jqconsole-2.6.min.js', 'lib/bootstrap-tooltip.js']
+CSS = ['style.css', 'mobile.css', 'print.css']
APP_FILES = ['base.coffee', 'browser-check.coffee', 'hash.coffee', 'dom.coffee',
'repl.coffee', 'pager.coffee', 'session.coffee',
'languages.coffee', 'analytics.coffee']
@@ -107,9 +108,10 @@ task 'bake', 'Build a final folder ready for deployment', ->
minifyCSS = ->
console.log 'Minifying CSS.'
fs.mkdirSync 'build/css', 0o755
- exec "#{CSS_MINIFIER} -o build/css/style.css css/style.css", ->
- exec "#{CSS_MINIFIER} -o build/css/mobile.css css/mobile.css", ->
- exec "#{CSS_MINIFIER} -o build/css/reset.css css/reset.css", updateHTML
+ minify = (i) ->
+ return updateHTML() if not CSS[i]?
+ exec "#{CSS_MINIFIER} -o build/css/#{CSS[i]} css/#{CSS[i]}", -> minify i + 1
+ minify 0
buildCore = ->
console.log 'Baking core JS.'
View
5 index.html
@@ -31,7 +31,8 @@
<script src="/jsrepl/repl.js?{{CACHE_BUSTER}}" id="jsrepl-script"></script>
<script src="/jsrepl/languages.js?{{CACHE_BUSTER}}"></script>
<!-- repl.it -->
- <script src="/lib/jqconsole-2.6.min.js?{{CACHE_BUSTER}}"></script>
+ <script src="/lib/jqconsole-2.6.min.js"></script>
+ <script src="/lib/bootstrap-tooltip.js"></script>
<script src="/base.js?{{CACHE_BUSTER}}"></script>
<script src="/browser-check.js?{{CACHE_BUSTER}}"></script>
<script src="/hash.js?{{CACHE_BUSTER}}"></script>
@@ -41,9 +42,9 @@
<script src="/session.js?{{CACHE_BUSTER}}"></script>
<script src="/languages.js?{{CACHE_BUSTER}}"></script>
<script src="/analytics.js?{{CACHE_BUSTER}}"></script>
+
<!--/UNBAKED-->
<script src="/lib/ace/ace.js"></script>
- <script src="/lib/bootstrap-tooltip.js"></script>
<!-- Session -->
<script>try{ {{SESSION_PLACEHOLDER}} } catch(e) {}</script>

0 comments on commit e7e53d2

Please sign in to comment.
Something went wrong with that request. Please try again.