-
Notifications
You must be signed in to change notification settings - Fork 304
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
113 lines (97 loc) · 2.67 KB
/
Copy pathGruntfile.coffee
File metadata and controls
113 lines (97 loc) · 2.67 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
module.exports = (grunt) ->
require('load-grunt-tasks') grunt , {
pattern: ['grunt-*', '!grunt-template-jasmine-istanbul']
}
# Read package.json to make sure it's there
pkg = grunt.file.readJSON('package.json')
# !! Compile configurations
LICENSE = '/*!Copyright(c) CommentCoreLibrary v' + pkg.version +
' (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT License */'
# !! End of config area
CSS = [
'src/css/base.css',
'src/css/fontalias.css'
]
# ==== Below this point is logic to generate compile configurations ====
# You probably do not need to edit anything below here
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.initConfig(
clean:
temp: [
'compiled_spec/',
'compiled_src/'
]
dist: [
'dist'
]
# Compile TypeScript
ts: {
default: {
tsconfig: './tsconfig.json'
}
}
# Copy
copy:
scripting_sandbox:
files:[
{expand: true, cwd:'src/scripting/api/', src: ['*.js'], dest:'dist/scripting/api/'},
{expand: true, cwd:'src/scripting/', src: ['OOAPI.js','Worker.js'], dest:'dist/scripting/'}
]
# Auto-prefix CSS properties using Can I Use?
autoprefixer:
options:
browsers: ['last 3 versions', 'bb 10', 'android 3']
no_dest:
# File to output
src: 'dist/css/style.css'
# Minify CSS
cssmin:
minify:
src: ['dist/css/style.css']
dest: 'dist/css/style.min.css'
# Minify JS
uglify:
options:
banner: LICENSE
all:
files:
'dist/CommentCoreLibrary.min.js': ['dist/CommentCoreLibrary.js']
# Watch files for changes
watch:
scripting:
files: ['src/scripting/**/*', '!node_modules']
tasks: ['build:scripting']
core:
files: ['src/**/*', '!node_modules', '!src/scripting/**/*']
tasks: ['build']
# JSHint
jshint:
options:
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
strict: false,
mocha: true
all:
src: ['src/*.js']
coffee:
glob_to_multiple:
expand: true,
flatten: true,
src: ['spec/**/*.coffee']
dest: 'compiled_spec/'
ext: '.js'
)
# Register our tasks
grunt.registerTask 'build', ['clean', 'ts']
grunt.registerTask 'test', ['build'] # And do tests
grunt.registerTask 'ci', ['build'] # Do CI stuff
grunt.registerTask 'default', ['build', 'watch']