forked from ryanbagwell/django-cms-named-menus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
92 lines (78 loc) · 2.36 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
path = require 'path'
shelljs = require 'shelljs'
module.exports = (grunt) ->
_ = grunt.util._
# Used instead of "ext" to accommodate filenames with dots. Lots of
# talk all over GitHub, including here: https://github.com/gruntjs/grunt/pull/750
coffeeRename = (dest, src) -> path.join dest, "#{ src.replace /\.(lit)?coffee$/, '.js' }"
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
less:
compile:
files: [
expand: true
cwd: './cms_named_menus/static/cmsnamedmenus/less'
src: ['admin.less']
dest: './cms_named_menus/static/cmsnamedmenus/css'
ext: '.css'
]
watch:
options:
spawn: true
coffee:
options:
cwd: './cms_named_menus/static/cmsnamedmenus/coffee'
files: ['**/*.coffee']
tasks: ['webpack']
less:
options:
cwd: './cms_named_menus/static/cmsnamedmenus/less'
files: ['**/*.less']
tasks: ['less']
uglify:
options:
mangle: false
files:
expand: true
flatten: false
cwd: './cms_named_menus/static/cmsnamedmenus/coffee'
src: '**/*.js'
dest: './cms_named_menus/static/eventtracking/js'
webpack:
all:
cache: true
devtool: 'sourcemap'
entry:
"admin": "admin"
output:
path: "cms_named_menus/static/cmsnamedmenus/js"
filename: "[name].js"
library: 'App'
resolve:
extensions: ['.coffee', '.js', '']
modulesDirectories: [
'node_modules'
'./cms_named_menus/static/cmsnamedmenus/coffee/'
]
alias:
'jquery-nestable':'jquery-nestable/jquery.nestable'
module:
loaders: [
{test: /jquery\.js$/, loader: 'expose?$!expose?jQuery'}
{test: /\.coffee$/, loader: 'coffee'}
]
stats:
colors: true
modules: true
reasons: true
watch: false
keepalive: false
# Load grunt plugins
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-webpack'
# Define tasks.
grunt.registerTask 'build', ['less', 'webpack:all']