This repository has been archived by the owner on Sep 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.coffee
99 lines (85 loc) · 2.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
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
'use strict'
# AngularJS Authentication and Autorization for Django REST Framework
#
# Copyright 2016 (C) TEONITE - http://teonite.com
module.exports = (grunt)->
# time grunt init
require('time-grunt')(grunt)
# load all grunt tasks
(require 'matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
_ = grunt.util._
path = require 'path'
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffeelint:
gruntfile:
src: '<%= watch.gruntfile.files %>'
src:
src: '<%= watch.src.files %>'
options:
no_trailing_whitespace:
level: 'error'
max_line_length:
level: 'warn'
coffee:
src:
expand: true
cwd: 'src/'
src: ['**/*.coffee']
dest: 'compiled/'
ext: '.js'
# copy:
# html:
# expand: true
# cwd: 'src'
# src: ['**/*.js']
# dest: 'dist/'
watch:
gruntfile:
files: 'Gruntfile.coffee'
tasks: ['coffeelint:gruntfile']
src:
files: ['src/**/*.coffee']
tasks: ['coffeelint:src', 'coffee:src']
html:
files: ['src/**/*.html']
tasks: ['copy']
html2js:
options:
module: 'login.templates',
htmlmin:
collapseWhitespace: true
removeComments: true
main:
src: [ '**/templates/*.html' ]
dest: 'src/templates.js'
concat:
dist:
files:
'dist/angular-auth.js': [ 'compiled/**/*.js', 'src/templates.js']
connect:
server:
options:
base: 'example'
port: 9999
keepalive: true
clean: ['dist/', 'compiled/']
# tasks.
grunt.registerTask 'compile', [
'coffeelint'
'coffee'
]
grunt.registerTask 'build', [
'clean',
'coffee',
'html2js',
'concat'
]
grunt.registerTask 'start', [
'build',
'connect'
]
grunt.registerTask 'default', [
'build'
]