forked from raffazizzi/coreBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
81 lines (70 loc) · 2.41 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module.exports = (grunt) ->
'use strict'
# Load plugins.
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-install-dependencies'
grunt.loadNpmTasks 'grunt-bower-cli'
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
uglify:
dev:
options:
mangle: false
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
files:
'dist/<%= pkg.name %>.min.js': [ 'dist/<%= pkg.name %>.js' ]
coffee:
compile:
files:
'dist/<%= pkg.name %>.js': ['src/*.coffee']
connect:
server:
options:
port: 8000
hostname: "localhost"
open: true
watch:
scripts:
files: ['src/*.coffee', 'less/*.less']
tasks: ['coffee']
options:
livereload: true
styles:
files: ['less/*.less']
tasks: ['less']
options:
nospawn: true
less:
dev:
files:
'css/main.css': 'less/main.less'
concat:
bower_js:
options:
separator: "\n"
src: ['bower_components/jquery/jquery.min.js',
'bower_components/underscore/underscore-min.js',
'bower_components/backbone/backbone.js',
'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/bootstrap/js/tabs.js',
'bower_components/bootstrap-multiselect/js/bootstrap-multiselect.js',
'bower_components/FileSaver/FileSaver.js',
'bower_components/vkbeautify/index.js',
'bower_components/prism/prism.js']
dest: 'dist/bower.js'
copy:
ace:
files: [{expand: true, cwd: 'bower_components/ace-builds/src-min/', src: ['**'], dest: 'dist/ace/'}]
fonts:
files: [{expand: true, cwd: 'bower_components/bootstrap/dist/fonts/', src: ['*'], dest: 'fonts/'}]
# Task(s).
grunt.registerTask 'default', ['coffee', 'uglify', 'less']
grunt.registerTask 'run', ['connect', 'watch']
grunt.registerTask 'build', ['install-dependencies', 'bower', 'concat', 'copy:fonts', 'copy:ace']