Uglify js

This commit is contained in:
Vit Brunner
2014-10-29 10:52:00 +01:00
parent f3b4290ad3
commit a3a70eedd4
9 changed files with 59 additions and 23 deletions
+24 -1
View File
@@ -18,7 +18,29 @@ module.exports = (grunt) ->
watch: {
main: {
files: '<%= var.source %>/**/*'
tasks: ['default']
tasks: ['default', 'qunit']
}
min: {
files: [
'<%= var.destination %>/scripts/**/*.js'
'<%= var.destination %>/bower_components/**/*.js'
]
tasks: ['uglify']
}
}
uglify: {
main: {
files: {
'build/min/scripts.js': [
'build/bower_components/lodash/dist/lodash.js'
'build/bower_components/angular/angular.js'
'build/bower_components/angular-route/angular-route.js'
'build/bower_components/angular-sanitize/angular-sanitize.js'
'build/bower_components/marked/lib/marked.js'
'build/scripts/**/*.js'
]
}
}
}
@@ -72,6 +94,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-stylus');
+1
View File
@@ -9,6 +9,7 @@
"grunt-cli": "0.1.x",
"grunt-contrib-connect": "0.8.x",
"grunt-contrib-watch": "0.6.x",
"grunt-contrib-uglify": "0.6.x",
"grunt-contrib-copy": "0.7.x",
"grunt-contrib-coffee": "0.12.x",
"grunt-contrib-stylus": "0.20.x",
+16
View File
@@ -0,0 +1,16 @@
body(ng-controller="AppController")
noscript Well, terribly sorry but you do need to have Javascript enabled.
// top menu
.pure-menu.pure-menu-open.pure-menu-horizontal.menu-main
ul
li
a(href="#{{base}}") Home
li
a(href="#{{base}}/pick") Pick
li
a(href="#") Help
li
a(href="#") About
div(ng-view class="cols-{{columns}}")
@@ -3,7 +3,6 @@ script(src="bower_components/lodash/dist/lodash.js")
script(src="bower_components/angular/angular.js")
script(src="bower_components/angular-route/angular-route.js")
script(src="bower_components/angular-sanitize/angular-sanitize.js")
script(src="bower_components/angular-sanitize/angular-sanitize.js")
script(src="bower_components/marked/lib/marked.js")
script(src="scripts/app.js")
script(src="scripts/services/fetch.js")
+12
View File
@@ -0,0 +1,12 @@
doctype html
html(ng-app="sideBySide")
head
title Side By Side viewer
meta(charset="utf-8")
link(rel="stylesheet", type="text/css", href="//fonts.googleapis.com/css?family=Noticia+Text:400,700,400italic,700italic")
link(rel="stylesheet", type="text/css", href="bower_components/fontawesome/css/font-awesome.min.css")
link(rel="stylesheet", type="text/css", href="bower_components/pure/pure-min.css")
link(rel="stylesheet", type="text/css", href="styles/style.css")
script(src="min/scripts.js")
include includes/body.html.jade
+2 -17
View File
@@ -7,21 +7,6 @@ html(ng-app="sideBySide")
link(rel="stylesheet", type="text/css", href="bower_components/fontawesome/css/font-awesome.min.css")
link(rel="stylesheet", type="text/css", href="bower_components/pure/pure-min.css")
link(rel="stylesheet", type="text/css", href="styles/style.css")
include _scripts.html.jade
include includes/scripts.html.jade
body(ng-controller="AppController")
noscript Well, terribly sorry but you do need to have Javascript enabled.
// top menu
.pure-menu.pure-menu-open.pure-menu-horizontal.menu-main
ul
li
a(href="#{{base}}") Home
li
a(href="#{{base}}/pick") Pick
li
a(href="#") Help
li
a(href="#") About
div(ng-view class="cols-{{columns}}")
include includes/body.html.jade
@@ -9,7 +9,7 @@ angular.module("sideBySide.controllers", [])
appUrl = $location.absUrl()
.substring(0, $location.absUrl().length - $location.url().length)
.replace(/#$/, '')
.replace(/[^\/]*?#$/, '')
base = appUrl + $location.url()
.slice(1)
@@ -1,4 +1,4 @@
angular.module("sideBySide").factory("readerFactory", ($injector) ->
angular.module("sideBySide").factory "readerFactory", ['$injector', ($injector) ->
# Create poem reader based on file name
#
# @param [String] Source file name
@@ -12,4 +12,4 @@ angular.module("sideBySide").factory("readerFactory", ($injector) ->
return $injector.get("markdownReader")
else
throw "Unknown extension '" + extension + "'."
)
]
+1 -1
View File
@@ -4,7 +4,7 @@ html
title Side By Side test suite
meta(charset="utf-8")
include _scripts.html.jade
include includes/scripts.html.jade
// test scripts
link(rel="stylesheet", type="text/css", href="bower_components/qunit/qunit/qunit.css")