was.wm.js – Diff between revs 6 and 8

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 6 Rev 8
1 /*global module:false*/ 1 /*global module:false*/
2 module.exports = function(grunt) { 2 module.exports = function(grunt) {
3   3  
4 // Project configuration. 4 // Project configuration.
5 grunt.initConfig({ 5 grunt.initConfig({
6 // Metadata. 6 // Metadata.
7 pkg: grunt.file.readJSON('package.json'), 7 pkg: grunt.file.readJSON('package.json'),
8 banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + 8 banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
9 '<%= grunt.template.today("yyyy-mm-dd") %> \n' + 9 '<%= grunt.template.today("yyyy-mm-dd") %> \n' +
10 '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + 10 '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
11 '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + 11 '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' +
12 ' Licensed <%= pkg.license %> */\n', 12 ' Licensed <%= pkg.license %> */\n',
13 // Task configuration. 13 // Task configuration.
14 concat: { 14 concat: {
15 options: { 15 options: {
16 banner: '<%= banner %>', 16 banner: '<%= banner %>',
17 stripBanners: true 17 stripBanners: true
18 }, 18 },
19 dist: { 19 dist: {
-   20 src: [
-   21 'node_modules/interact.js/interact.js',
-   22 'node_modules/js-cookie/src/js.cookie.js',
20 src: ['lib/**/*.js'], 23 'lib/**/*.js'
-   24 ],
21 dest: 'dist/<%= pkg.name %>' // <%= pkg.name %>.js -> was.wm.js 25 dest: 'dist/<%= pkg.name %>' // <%= pkg.name %>.js -> was.wm.js
22 } 26 }
23 }, 27 },
24 uglify: { 28 uglify: {
25 options: { 29 options: {
26 banner: '<%= banner %>' 30 banner: '<%= banner %>'
27 }, 31 },
28 dist: { 32 dist: {
29 src: '<%= concat.dist.dest %>', 33 src: '<%= concat.dist.dest %>',
30 dest: 'dist/was.wm.min.js' // <%= pkg.name %>.min.js -> was.wm.min.js 34 dest: 'dist/was.wm.min.js' // <%= pkg.name %>.min.js -> was.wm.min.js
31 } 35 }
32 }, 36 },
33 jshint: { 37 jshint: {
34 options: { 38 options: {
35 curly: true, 39 curly: true,
36 eqeqeq: true, 40 eqeqeq: true,
37 immed: true, 41 immed: true,
38 latedef: true, 42 latedef: true,
39 newcap: true, 43 newcap: true,
40 noarg: true, 44 noarg: true,
41 sub: true, 45 sub: true,
42 undef: true, 46 undef: true,
43 unused: false, 47 unused: false,
44 boss: true, 48 boss: true,
45 eqnull: true, 49 eqnull: true,
46 globals: { 50 globals: {
47 '$': false, 51 '$': false,
48 'module': false, 52 'module': false,
49 'document' : false, 53 'document' : false,
50 'window' : false, 54 'window' : false,
51 'interact' : false, 55 'interact' : false,
52 'Cookies' : false, 56 'Cookies' : false,
53 jQuery: true 57 jQuery: true
54 }, 58 },
55 // spread/rest operator 59 // spread/rest operator
56 esnext: true 60 esnext: true
57 }, 61 },
58 gruntfile: { 62 gruntfile: {
59 src: 'Gruntfile.js' 63 src: 'Gruntfile.js'
60 }, 64 },
61 lib_test: { 65 lib_test: {
62 src: ['lib/**/*.js', 'test/**/*.js'] 66 src: ['lib/**/*.js', 'test/**/*.js']
63 } 67 }
64 }, 68 },
65 nodeunit: { 69 nodeunit: {
66 files: ['test/**/*_test.js'] 70 files: ['test/**/*_test.js']
67 }, 71 },
68 sass: { 72 sass: {
69 dist: { 73 dist: {
70 options: { 74 options: {
71 style: 'expanded' 75 style: 'expanded'
72 }, 76 },
73 files: { 77 files: {
74 'css/wm.css': 'css/wm.scss' 78 'css/wm.css': 'css/wm.scss'
75 } 79 }
76 } 80 }
77 }, 81 },
78 watch: { 82 watch: {
79 gruntfile: { 83 gruntfile: {
80 files: '<%= jshint.gruntfile.src %>', 84 files: '<%= jshint.gruntfile.src %>',
81 tasks: ['jshint:gruntfile'] 85 tasks: ['jshint:gruntfile']
82 }, 86 },
83 lib_test: { 87 lib_test: {
84 files: '<%= jshint.lib_test.src %>', 88 files: '<%= jshint.lib_test.src %>',
85 tasks: ['jshint:lib_test', 'nodeunit'] 89 tasks: ['jshint:lib_test', 'nodeunit']
86 } 90 }
87 } 91 }
88 }); 92 });
89   93  
90 // These plugins provide necessary tasks. 94 // These plugins provide necessary tasks.
91 grunt.loadNpmTasks('grunt-contrib-sass'); 95 grunt.loadNpmTasks('grunt-contrib-sass');
92 grunt.loadNpmTasks('grunt-contrib-concat'); 96 grunt.loadNpmTasks('grunt-contrib-concat');
93 grunt.loadNpmTasks('grunt-contrib-uglify-es'); 97 grunt.loadNpmTasks('grunt-contrib-uglify-es');
94 //grunt.loadNpmTasks('grunt-contrib-nodeunit'); 98 //grunt.loadNpmTasks('grunt-contrib-nodeunit');
95 grunt.loadNpmTasks('grunt-contrib-jshint'); 99 grunt.loadNpmTasks('grunt-contrib-jshint');
96 grunt.loadNpmTasks('grunt-contrib-watch'); 100 grunt.loadNpmTasks('grunt-contrib-watch');
97   101  
98 // Default task. 102 // Default task.
99 grunt.registerTask( 103 grunt.registerTask(
100 'default', 104 'default',
101 [ 105 [
102 'sass', 106 'sass',
103 'jshint', 107 'jshint',
104 //'nodeunit', 108 //'nodeunit',
105 'concat', 109 'concat',
106 'uglify' 110 'uglify'
107 ] 111 ]
108 ); 112 );
109   113  
110 }; 114 };
111   115