This repository was archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
162 lines (152 loc) · 4.26 KB
/
Gruntfile.coffee
File metadata and controls
162 lines (152 loc) · 4.26 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
module.exports = (grunt) ->
'use strict'
# Grunt project configuration.
# ----------------------
@initConfig
pkg: grunt.file.readJSON("package.json")
# Release a new version task.
# https://github.com/geddski/grunt-release
# ----------------------------------------
release:
options:
npm: false
# JSHint task.
# https://github.com/gruntjs/grunt-contrib-jshint
# -----------------------------------------------
jshint:
options:
jshintrc: ".jshintrc"
all: [
"plugins/*/lib/*-plugin.js"
"lib/css.js"
"lib/dom.js"
"lib/range.js"
"lib/selection.js"
]
# Clear files and folders task.
# https://github.com/gruntjs/grunt-contrib-clean
# ----------------------------------------------
clean:
dist: [
"dist/_*.css"
]
# Task for embedding images as base64 data URIs inside your stylesheets.
# https://npmjs.org/package/grunt-image-embed
# ----------------------------------------------------------------------
imageEmbed:
charmap:
src: "plugins/charmap/css/styles.css"
dest: "dist/_charmap.css"
colorpicker:
src: "plugins/colorpicker/css/styles.css"
dest: "dist/_colorpicker.css"
font:
src: "plugins/font/css/styles.css"
dest: "dist/_font.css"
codemirror:
src: "plugins/htmlsource/css/codemirror.css"
dest: "dist/_codemirror.css"
htmlsource:
src: "plugins/htmlsource/css/htmlsource.css"
dest: "dist/_htmlsource.css"
reset:
src: "plugins/reset/css/styles.css"
dest: "dist/_reset.css"
styles:
src: "plugins/styles/css/styles.css"
dest: "dist/_styles.css"
textresize:
src: "plugins/textresize/css/textresize.css"
dest: "dist/_textresize.css"
textformat:
src: "plugins/textformat/css/styles.css"
dest: "dist/_textformat.css"
options:
deleteAfterEncoding : false
# Task for compress CSS files.
# https://github.com/gruntjs/grunt-contrib-cssmin
# -----------------------------------------------
cssmin:
options:
report: "min"
minify:
files:
"dist/plugins.min.css": [
"dist/_*.css"
"plugins/colorpicker/vendor/spectrum/spectrum.css"
]
# RequireJS task.
# https://github.com/gruntjs/grunt-contrib-requirejs
# --------------------------------------------------
requirejs:
options:
optimize: "uglify"
paths:
"charmap": "plugins/charmap/lib"
"colorpicker": "plugins/colorpicker/lib"
"colorpicker/vendor": "plugins/colorpicker/vendor"
"font": "plugins/font/lib"
"htmlsource": "plugins/htmlsource/lib"
"reset": "plugins/reset/lib"
"styles": "plugins/styles/lib"
"textformat": "plugins/textformat/lib"
"textresize": "plugins/textresize/lib"
"aptoma/lib/dom": "lib/dom"
"aptoma/lib/css": "lib/css"
"aptoma/lib/selection": "lib/selection"
"aptoma/lib/range": "lib/range"
"aptoma/lib/style": "lib/style"
"aptoma/lib/ui/menuButton": "lib/ui/menuButton"
"aloha": "empty:"
"ui/ui": "empty:"
"ui/button": "empty:"
"ui/component": "empty:"
"ui/utils": "empty:"
"aloha/plugin": "empty:"
"aloha/rangy-core": "empty:"
"PubSub": "empty:"
"jquery": "empty:"
"jqueryui": "empty:"
"ui/toggleButton": "empty:"
"format/format-plugin": "empty:"
compile:
options:
out: "dist/plugins.min.js"
include: [
"charmap/charmap-plugin"
"colorpicker/colorpicker-plugin"
"font/font-plugin"
"htmlsource/htmlsource-plugin"
"reset/reset-plugin"
"styles/styles-plugin"
"textformat/textformat-plugin"
"textresize/textresize-plugin"
]
# Run tasks whenever watched files change.
# https://github.com/gruntjs/grunt-contrib-watch
# ----------------------------------------------
watch:
js:
files: "plugins/**/*.js"
tasks: ["jshint", "requirejs"]
css:
files: "plugins/**/*.css"
tasks: ["imageEmbed", "cssmin"]
# Load tasks.
# -----------
@loadNpmTasks "grunt-contrib-jshint"
@loadNpmTasks "grunt-contrib-requirejs"
@loadNpmTasks "grunt-contrib-clean"
@loadNpmTasks "grunt-contrib-cssmin"
@loadNpmTasks "grunt-contrib-watch"
@loadNpmTasks "grunt-image-embed"
@loadNpmTasks "grunt-release"
# Register tasks.
# ---------------
@registerTask "default", [
"jshint"
"requirejs"
"imageEmbed"
"cssmin"
"clean"
]