mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Separate min dir, one index
This commit is contained in:
+42
-13
@@ -20,6 +20,7 @@ module.exports = (grunt) ->
|
||||
'bower_components/pure/pure-min.css'
|
||||
'styles/style.css'
|
||||
]
|
||||
min: false
|
||||
}
|
||||
|
||||
grunt.initConfig {
|
||||
@@ -37,11 +38,17 @@ module.exports = (grunt) ->
|
||||
}
|
||||
|
||||
connect: {
|
||||
server: {
|
||||
main: {
|
||||
options: {
|
||||
base: 'build'
|
||||
}
|
||||
}
|
||||
min: {
|
||||
options: {
|
||||
port: 8001
|
||||
base: 'build-min'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
copy: {
|
||||
@@ -51,12 +58,18 @@ module.exports = (grunt) ->
|
||||
src: 'tests/the_raven/*'
|
||||
dest: 'build'
|
||||
}
|
||||
min: {
|
||||
expand: true
|
||||
cwd: 'source'
|
||||
src: 'tests/the_raven/*'
|
||||
dest: 'build-min'
|
||||
}
|
||||
}
|
||||
|
||||
cssmin: {
|
||||
main: {
|
||||
min: {
|
||||
files: {
|
||||
'build/min/styles.css': ('build/' + style for style in vars.styles)
|
||||
'build-min/styles.css': ('build/' + style for style in vars.styles)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,6 +83,21 @@ module.exports = (grunt) ->
|
||||
ext: '.html'
|
||||
options: {
|
||||
data: vars
|
||||
pretty: true
|
||||
}
|
||||
}
|
||||
min: {
|
||||
expand: true
|
||||
cwd: 'source'
|
||||
src: '**/*.jade'
|
||||
dest: 'build-min'
|
||||
ext: '.html'
|
||||
options: {
|
||||
data: {
|
||||
scripts: vars.scripts
|
||||
styles: vars.styles
|
||||
min: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,21 +121,21 @@ module.exports = (grunt) ->
|
||||
}
|
||||
|
||||
uglify: {
|
||||
main: {
|
||||
min: {
|
||||
files: {
|
||||
'build/min/scripts.js': ('build/' + script for script in vars.scripts)
|
||||
'build-min/scripts.js': ('build/' + script for script in vars.scripts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watch: {
|
||||
main: {
|
||||
files: 'source'
|
||||
tasks: ['default', 'qunit']
|
||||
files: 'source/**/*'
|
||||
tasks: [ 'default' ]
|
||||
}
|
||||
min: {
|
||||
files: ('build/' + script for script in vars.scripts)
|
||||
tasks: ['uglify']
|
||||
files: 'build/**/*'
|
||||
tasks: [ 'min' ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,7 +150,8 @@ module.exports = (grunt) ->
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
|
||||
grunt.registerTask 'default', [ 'copy', 'coffee', 'stylus', 'jade' ]
|
||||
grunt.registerTask 'serve', [ 'default', 'connect', 'watch' ]
|
||||
grunt.registerTask 'test', [ 'default', 'connect', 'qunit' ]
|
||||
grunt.registerTask 'min', [ 'default', 'uglify', 'cssmin' ]
|
||||
grunt.registerTask 'default', [ 'copy:main', 'coffee', 'stylus', 'jade:main' ]
|
||||
grunt.registerTask 'min', [ 'jade:min', 'copy:min', 'uglify', 'cssmin' ]
|
||||
|
||||
grunt.registerTask 'serve', [ 'default', 'min', 'connect', 'watch' ]
|
||||
grunt.registerTask 'test', [ 'default', 'connect:main', 'qunit' ]
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
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}}")
|
||||
@@ -1,10 +0,0 @@
|
||||
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="min/styles.css")
|
||||
script(src="min/scripts.js")
|
||||
|
||||
include includes/body.html.jade
|
||||
+25
-5
@@ -4,9 +4,29 @@ html(ng-app="sideBySide")
|
||||
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")
|
||||
for style in styles
|
||||
link(rel="stylesheet", type="text/css", href="#{style}")
|
||||
for script in scripts
|
||||
script(src="#{script}")
|
||||
|
||||
include includes/body.html.jade
|
||||
if min == true
|
||||
link(rel="stylesheet", type="text/css", href="styles.css")
|
||||
script(src="scripts.js")
|
||||
else
|
||||
for style in styles
|
||||
link(rel="stylesheet", type="text/css", href="#{style}")
|
||||
for script in scripts
|
||||
script(src="#{script}")
|
||||
|
||||
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}}")
|
||||
|
||||
Reference in New Issue
Block a user