-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
96 lines (88 loc) · 2.57 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
88
89
90
91
92
93
94
95
96
module.exports = function(grunt) {
grunt.initConfig({
concat: {
dist: {
src: ['js/*.js'],
dest: 'dist/js/scripts.js'
}
},
uglify: {
dist: {
files: {
'dist/js/scripts.min.js': 'dist/js/scripts.js'
}
}
},
shell: { // Use shell to run Dart Sass
sass: {
command: 'sass --no-source-map scss/styles.scss dist/css/styles.css --style=compressed'
}
},
imagemin: {
static: {
options: {
optimizationLevel: 7
},
files: [{
expand: true,
cwd: 'dist/projects/',
src: [
'city-engine/images/*.{png,jpg,gif}',
'dashboard/images/*.{png,jpg,gif}',
'inca/images/*.{png,jpg,gif}',
'industries/images/*.{png,jpg,gif}',
'my-esri/images/*.{png,jpg,gif}',
'public-health/images/*.{png,jpg,gif}',
'save-me/images/*.{png,jpg,gif}',
// 'urb-ob-site/images/*.{png,jpg,gif}',
// 'calcite-ui-icons/images/*.{png,jpg,gif}',
'automated-system-icons/images/*.{png,jpg,gif}',
'urb-ob/images/*.{png,jpg,gif}',
'web-app-builder/images/*.{png,jpg,gif}',
'calcite-design-system/images/*.{png,jpg,gif}',
'zip-tapestry/images/*.{png,jpg,gif}',
'esri-product-logos/images/*.{png,jpg,gif}',
'programs-dashboard/images/*.{png,jpg,gif}',
'calcite-components/images/*.{png,jpg,gif}'
],
dest: 'dist/projects/'
}]
}
},
connect: {
server: {
options: {
hostname: 'localhost',
port: 3333,
base: 'dist/',
livereload: true
}
}
},
watch: {
options: {
spawn: false,
livereload: true
},
scripts: {
files: [
'dist/*.html',
'dist/js/*.json',
'dist/projects/**/*',
'js/**/*.js',
'scss/**/*.scss'
],
tasks: ['concat', 'uglify', 'shell:sass'] // Run Dart Sass via shell command
}
}
}); // initConfig
// Load necessary Grunt tasks
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-shell'); // Load grunt-shell for Dart Sass
// Register default task
grunt.registerTask('default', ['concat', 'uglify', 'shell:sass', 'connect', 'watch']);
};