-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.coffee
31 lines (26 loc) · 1.22 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
GruntVTEX = require 'grunt-vtex'
module.exports = (grunt) ->
pkg = grunt.file.readJSON 'package.json'
replaceMap = {}
replaceMap["/speedbag/"] = "//io.vtex.com.br/#{pkg.name}/#{pkg.version}/"
replaceMap["\<\!\-\-remove\-\-\>(.|\n)*\<\!\-\-endremove\-\-\>"] = ""
config = GruntVTEX.generateConfig grunt, pkg,
followHttps: true
replaceMap: replaceMap
livereload: !grunt.option('no-lr')
relativePath: "speedbag"
tasks =
# Building block tasks
build: ['clean', 'concat:templates', 'copy:main', 'copy:pkg', 'nginclude', 'coffee', 'less', 'ngtemplates']
min: ['useminPrepare', 'concat', 'uglify', 'cssmin', 'usemin'] # minifies files
# Deploy tasks
dist: ['build', 'min', 'copy:deploy'] # Dist - minifies files
test: []
vtex_deploy: ['shell:cp', 'shell:cp_br']
# Development tasks
default: ['getTags', 'build', 'copy:dev', 'connect', 'watch']
devmin: ['getTags', 'build', 'copy:dev', 'min', 'connect:http:keepalive'] # Minifies files and serve
# Project configuration.
grunt.config.init config
grunt.loadNpmTasks name for name of pkg.devDependencies when name[0..5] is 'grunt-' and name isnt 'grunt-vtex'
grunt.registerTask taskName, taskArray for taskName, taskArray of tasks