-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
45 lines (37 loc) · 1.02 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
_s = require 'underscore.string'
module.exports = (grunt) ->
pkg = grunt.file.readJSON('package.json')
grunt.initConfig
config:
filename: pkg.name
clean:
dist: ["dist"]
lib: ["lib"]
coffee:
lib:
expand: true
cwd:'src'
src: ['**/*.coffee']
dest: 'lib'
ext: '.js'
options:
bare:true
browserify:
dist:
files:
'dist/<%= config.filename %>.js':['lib/<%= config.filename %>.js']
options:
transform: ['browserify-shim']
bundleOptions:
standalone:_s.camelize(pkg.name)
uglify:
dist:
options:
mangle: false
files:
'dist/<%= config.filename %>.min.js':['dist/<%= config.filename %>.js']
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-browserify"
grunt.registerTask "default", ["clean", "coffee", "browserify", "uglify"]