1
- 'use strict' ;
1
+ 'use strict'
2
2
3
3
const processors = [
4
- require ( 'cssnano' )
5
- ] ;
4
+ require ( 'cssnano' )
5
+ ]
6
6
7
7
const processorsFn = ( ) => {
8
- return [
9
- require ( 'cssnano' )
10
- ] ;
11
- } ;
8
+ return [
9
+ require ( 'cssnano' )
10
+ ]
11
+ }
12
12
13
13
module . exports = ( grunt ) => {
14
- require ( 'load-grunt-tasks' ) ( grunt ) ;
15
- require ( '@lodder/time-grunt' ) ( grunt ) ;
14
+ require ( 'load-grunt-tasks' ) ( grunt )
15
+ require ( '@lodder/time-grunt' ) ( grunt )
16
16
17
- grunt . initConfig ( {
18
- jshint : {
19
- all : [
20
- 'Gruntfile.js' ,
21
- 'tasks/*.js' ,
22
- '<%= nodeunit.tests %>' ,
23
- ] ,
24
- options : {
25
- jshintrc : '.jshintrc' ,
26
- } ,
27
- } ,
17
+ grunt . initConfig ( {
18
+ jshint : {
19
+ all : [
20
+ 'Gruntfile.js' ,
21
+ 'tasks/*.js' ,
22
+ '<%= nodeunit.tests %>' ,
23
+ ] ,
24
+ options : {
25
+ jshintrc : '.jshintrc' ,
26
+ } ,
27
+ } ,
28
28
29
- clean : {
30
- tests : [ 'tmp' ] ,
31
- } ,
29
+ clean : {
30
+ tests : [ 'tmp' ] ,
31
+ } ,
32
32
33
- postcss : {
34
- defaults : {
35
- options : {
36
- processors
37
- } ,
38
- src : 'test/fixtures/a.css' ,
39
- dest : 'tmp/defaults.css'
40
- } ,
41
- defaultsFn : {
42
- options : {
43
- processors : processorsFn
44
- } ,
45
- src : 'test/fixtures/a.css' ,
46
- dest : 'tmp/defaultsFn.css'
47
- } ,
48
- mapInline : {
49
- options : {
50
- map : true ,
51
- processors
52
- } ,
53
- src : 'test/fixtures/a.css' ,
54
- dest : 'tmp/mapInline.css'
55
- } ,
56
- mapSeparate : {
57
- options : {
58
- map : {
59
- inline : false
60
- } ,
61
- processors
62
- } ,
63
- src : 'test/fixtures/a.css' ,
64
- dest : 'tmp/mapSeparate.css'
65
- } ,
66
- mapAnnotationPath : {
67
- options : {
68
- map : {
69
- inline : false ,
70
- annotation : 'tmp/maps/'
71
- } ,
72
- processors
73
- } ,
74
- src : 'test/fixtures/a.css' ,
75
- dest : 'tmp/mapAnnotationPath.css'
76
- } ,
77
- diff : {
78
- options : {
79
- diff : true ,
80
- processors
81
- } ,
82
- src : 'test/fixtures/a.css' ,
83
- dest : 'tmp/diff.css'
84
- } ,
85
- syntax : {
86
- options : {
87
- syntax : require ( 'postcss-scss' ) ,
88
- processors : [ ]
89
- } ,
90
- src : 'test/fixtures/a.scss' ,
91
- dest : 'tmp/syntax.scss'
92
- } ,
93
- doWriteDest : {
94
- options : {
95
- syntax : require ( 'postcss-scss' ) ,
96
- writeDest : true
97
- } ,
98
- src : 'test/fixtures/a.scss' ,
99
- dest : 'tmp/doWriteDest.scss'
100
- } ,
101
- noWriteDest : {
102
- options : {
103
- syntax : require ( 'postcss-scss' ) ,
104
- writeDest : false
105
- } ,
106
- src : 'test/fixtures/a.scss' ,
107
- dest : 'tmp/noWriteDest.scss'
108
- } ,
109
- sequential : {
110
- options : {
111
- syntax : require ( 'postcss-scss' ) ,
112
- sequential : true
113
- } ,
114
- src : [ 'test/fixtures/a.scss' , 'test/fixtures/a.css' ] ,
115
- dest : 'tmp/sequential.css'
116
- }
33
+ postcss : {
34
+ defaults : {
35
+ options : {
36
+ processors,
117
37
} ,
118
-
119
- nodeunit : {
120
- tests : [ 'test/test.js' ] ,
38
+ src : 'test/fixtures/a.css' ,
39
+ dest : 'tmp/defaults.css' ,
40
+ } ,
41
+ defaultsFn : {
42
+ options : {
43
+ processors : processorsFn ,
44
+ } ,
45
+ src : 'test/fixtures/a.css' ,
46
+ dest : 'tmp/defaultsFn.css' ,
47
+ } ,
48
+ mapInline : {
49
+ options : {
50
+ map : true ,
51
+ processors,
52
+ } ,
53
+ src : 'test/fixtures/a.css' ,
54
+ dest : 'tmp/mapInline.css' ,
55
+ } ,
56
+ mapSeparate : {
57
+ options : {
58
+ map : {
59
+ inline : false ,
60
+ } ,
61
+ processors,
121
62
} ,
63
+ src : 'test/fixtures/a.css' ,
64
+ dest : 'tmp/mapSeparate.css' ,
65
+ } ,
66
+ mapAnnotationPath : {
67
+ options : {
68
+ map : {
69
+ inline : false ,
70
+ annotation : 'tmp/maps/' ,
71
+ } ,
72
+ processors,
73
+ } ,
74
+ src : 'test/fixtures/a.css' ,
75
+ dest : 'tmp/mapAnnotationPath.css' ,
76
+ } ,
77
+ diff : {
78
+ options : {
79
+ diff : true ,
80
+ processors,
81
+ } ,
82
+ src : 'test/fixtures/a.css' ,
83
+ dest : 'tmp/diff.css' ,
84
+ } ,
85
+ syntax : {
86
+ options : {
87
+ syntax : require ( 'postcss-scss' ) ,
88
+ processors : [ ] ,
89
+ } ,
90
+ src : 'test/fixtures/a.scss' ,
91
+ dest : 'tmp/syntax.scss' ,
92
+ } ,
93
+ doWriteDest : {
94
+ options : {
95
+ syntax : require ( 'postcss-scss' ) ,
96
+ writeDest : true ,
97
+ } ,
98
+ src : 'test/fixtures/a.scss' ,
99
+ dest : 'tmp/doWriteDest.scss' ,
100
+ } ,
101
+ noWriteDest : {
102
+ options : {
103
+ syntax : require ( 'postcss-scss' ) ,
104
+ writeDest : false ,
105
+ } ,
106
+ src : 'test/fixtures/a.scss' ,
107
+ dest : 'tmp/noWriteDest.scss' ,
108
+ } ,
109
+ sequential : {
110
+ options : {
111
+ syntax : require ( 'postcss-scss' ) ,
112
+ sequential : true ,
113
+ } ,
114
+ src : [ 'test/fixtures/a.scss' , 'test/fixtures/a.css' ] ,
115
+ dest : 'tmp/sequential.css' ,
116
+ }
117
+ } ,
118
+
119
+ nodeunit : {
120
+ tests : [ 'test/test.js' ] ,
121
+ } ,
122
122
123
- } ) ;
123
+ } )
124
124
125
- grunt . loadTasks ( 'tasks' ) ;
125
+ grunt . loadTasks ( 'tasks' )
126
126
127
- grunt . registerTask ( 'test' , [ 'clean' , 'postcss' , 'nodeunit' ] ) ;
128
- grunt . registerTask ( 'default' , [ 'jshint' , 'test' ] ) ;
129
- } ;
127
+ grunt . registerTask ( 'test' , [ 'clean' , 'postcss' , 'nodeunit' ] )
128
+ grunt . registerTask ( 'default' , [ 'jshint' , 'test' ] )
129
+ }
0 commit comments