Skip to content

Commit 71e2f3d

Browse files
author
Jerome Louis
committed
Add Gruntfile for dist generation
1 parent fc571d8 commit 71e2f3d

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Gruntfile.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module.exports = function (grunt) {
2+
grunt.loadNpmTasks('grunt-sass');
3+
grunt.loadNpmTasks('grunt-contrib-cssmin');
4+
grunt.loadNpmTasks('grunt-contrib-copy');
5+
grunt.loadNpmTasks('grunt-contrib-uglify');
6+
7+
grunt.initConfig({
8+
sass: {
9+
options: {
10+
outputStyle: 'expanded'
11+
},
12+
dist: {
13+
files: {
14+
'dist/gridstack.css': 'src/gridstack.scss',
15+
'dist/gridstack-extra.css': 'src/gridstack-extra.scss'
16+
}
17+
}
18+
},
19+
20+
cssmin: {
21+
dist: {
22+
files: {
23+
'dist/gridstack.min.css': ['dist/gridstack.css'],
24+
'dist/gridstack-extra.min.css': ['dist/gridstack-extra.css']
25+
}
26+
}
27+
},
28+
29+
copy: {
30+
dist: {
31+
files: {
32+
'dist/gridstack.js': ['src/gridstack.js']
33+
}
34+
}
35+
},
36+
37+
uglify: {
38+
options: {
39+
sourceMap: true,
40+
sourceMapName: 'dist/gridstack.min.map'
41+
},
42+
dist: {
43+
files: {
44+
'dist/gridstack.min.js': ['src/gridstack.js']
45+
}
46+
}
47+
}
48+
});
49+
50+
grunt.registerTask('default', ['sass', 'cssmin', 'copy', 'uglify']);
51+
};

package.json

100644100755
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,12 @@
1919
"bugs": {
2020
"url": "https://github.com/troolee/gridstack.js/issues"
2121
},
22-
"homepage": "http://troolee.github.io/gridstack.js/"
22+
"homepage": "http://troolee.github.io/gridstack.js/",
23+
"devDependencies": {
24+
"grunt": "^0.4.5",
25+
"grunt-contrib-copy": "^0.8.2",
26+
"grunt-contrib-cssmin": "^0.14.0",
27+
"grunt-contrib-uglify": "^0.10.1",
28+
"grunt-sass": "^1.1.0"
29+
}
2330
}

0 commit comments

Comments
 (0)