Browse Source

Add sass parser, add grunt watch

brantje 1 year ago
parent
commit
d0679c70fa
No account linked to committer's email address
1 changed files with 28 additions and 2 deletions
  1. 28
    2
      Gruntfile.js

+ 28
- 2
Gruntfile.js View File

@@ -32,6 +32,30 @@ module.exports = function (grunt) {
32 32
             },
33 33
             all: ['js/*', '!js/vendor']
34 34
         },
35
+        sass: {
36
+            options: {
37
+                sourceMap: true
38
+            },
39
+            dist: {
40
+                files: {
41
+                    'css/auto-login-popup.css': 'style/auto-login-popup.scss',
42
+                    'css/browser_action.css': 'style/browser_action.scss',
43
+                    'css/doorhanger.css': 'style/doorhanger.scss',
44
+                    'css/doorhanger-iframe.css': 'style/doorhanger-iframe.scss',
45
+                    'css/main.css': 'style/main.scss',
46
+                    'css/password_picker.css': 'style/password_picker.scss',
47
+                }
48
+            }
49
+        },
50
+        watch: {
51
+            scripts: {
52
+                files: ['style/**/*.scss', 'style/*.scss'],
53
+                tasks: ['sass'],
54
+                options: {
55
+                    spawn: false
56
+                }
57
+            }
58
+        },
35 59
         mkdir: {
36 60
             dist: {
37 61
                 options: {
@@ -45,7 +69,7 @@ module.exports = function (grunt) {
45 69
                 src: [
46 70
                     '**',
47 71
                     '*.xpi',
48
-		    '!fixLocale.js',
72
+                    '!fixLocale.js',
49 73
                     '!tests/*/**/*',
50 74
                     '!tests/*',
51 75
                     '!tests',
@@ -109,10 +133,12 @@ module.exports = function (grunt) {
109 133
     grunt.loadNpmTasks('grunt-contrib-clean');
110 134
     grunt.loadNpmTasks('grunt-execute');
111 135
     grunt.loadNpmTasks('grunt-karma');
136
+    grunt.loadNpmTasks('grunt-sass');
137
+    grunt.loadNpmTasks('grunt-contrib-watch');
112 138
     // Default task(s).
113 139
 
114 140
     grunt.registerTask('test', ['karma', 'jshint']);
115
-    grunt.registerTask('build', ['execute:fixLocale','jshint', 'clean:dist', 'mkdir:dist', 'copy:dist', 'compress:dist']);
141
+    grunt.registerTask('build', ['execute:fixLocale', 'sass', 'jshint', 'clean:dist', 'mkdir:dist', 'copy:dist', 'compress:dist']);
116 142
     grunt.registerTask('dist', ['']);
117 143
 
118 144
 };