forked from timber/starter-theme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
87 lines (82 loc) · 1.8 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('@lodder/grunt-postcss');
var themeJs = [
'assets/js/popper.js',
'assets/js/bootstrap.min.js',
'assets/js/theme.js',
];
var config = {
// Load data from package.json
pkg: grunt.file.readJSON('package.json'),
concat: {
themeJs: {
files: {
'dist/js/built.js': themeJs
}
},
},
uglify: {
options: {
sourceMap: false
},
themeJs: {
files: {
'dist/js/built.min.js': 'dist/js/built.js'
}
}
},
watch: {
sass: {
files: 'assets/style/**/*.scss',
tasks: ['sass:dev'],
options: {
livereload: true
}
},
},
sass: {
dev: {
options: {
lineNumbers: true,
sourcemap: true,
sourceComments: "sass",
outputStyle: 'nested'
},
files: {
'dist/css/built.css': 'assets/style/main.scss',
}
},
dist: {
options: {
compressed: true
},
files: {
'dist/css/built.css': 'assets/style/main.scss'
}
}
},
postcss: {
options: {
map: true,
processors: [
require('autoprefixer')({safe: true})
]
},
dist: {
src: 'dist/css/built.css'
}
},
cssmin: {
css:{
src: 'dist/css/built.css',
dest: 'dist/css/built.min.css'
}
}
};
// Initialize the configuration.
grunt.initConfig(config);
grunt.registerTask("prodbuild", ['sass:dist', 'concat', 'uglify', 'postcss', 'cssmin']);
grunt.registerTask("devbuild", ['sass:dev', 'concat', 'uglify', 'postcss', 'cssmin']);
grunt.registerTask("default", ['devbuild']);
};