forked from phase2/particle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpconfig.js
209 lines (209 loc) · 5.34 KB
/
gulpconfig.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
module.exports = {
css: {
enabled: true,
src: [
'scss/**/*.scss',
'source/_patterns/**/*.scss',
'source/styleguide/*.scss',
],
dest: 'dest/',
flattenDestOutput: true,
lint: {
enabled: true,
failOnError: true,
// in addition to linting `css.src`, this is added.
extraSrc: [],
},
// additional debugging info in comment of the output CSS - only use when necessary
sourceComments: false,
sourceMapEmbed: false,
// tell the compiler whether you want 'expanded' or 'compressed' output code
outputStyle: 'expanded',
// https://github.com/ai/browserslist#queries
autoPrefixerBrowsers: [
'last 2 versions',
'IE >= 10',
],
includePaths: [
'./node_modules',
'./bower_components',
],
// http://sassdoc.com
sassdoc: {
enabled: true,
dest: 'dest/sassdoc',
verbose: false,
basePath: 'https://github.com/phase2/pattern-lab-starter/blob/master/source/_patterns',
exclude: [],
theme: 'default',
// http://sassdoc.com/customising-the-view/#sort
sort: [
'file',
'group',
'line>',
],
},
},
js: {
enabled: true,
src: [
'js/**/*.js',
'source/_patterns/**/*.js',
],
dest: 'dest/',
destName: 'script.js',
sourceMapEmbed: false,
uglify: false,
babel: true,
// Will bundle all bower JS dependencies (not devDeps)
// creates a `bower_components.min.js` file in `js.dest`.
bundleBower: true,
eslint: {
enabled: true,
src: [
'js/**/*.js',
'source/_patterns/**/*.js',
'.*.js',
'*.js',
],
},
},
patternLab: {
enabled: true,
configFile: 'pattern-lab/config/config.yml',
watchedExtensions: [
'twig',
'json',
'yaml',
'yml',
'md',
'jpg',
'jpeg',
'png',
],
injectFiles: [],
injectBower: true,
bowerBasePath: './',
twigNamespaces: {
addToDrupalThemeFile: true,
sets: [
{
namespace: 'base',
paths: ['source/_patterns/00-base'],
}, {
namespace: 'atoms',
paths: ['source/_patterns/01-atoms'],
}, {
namespace: 'molecules',
paths: ['source/_patterns/02-molecules'],
}, {
namespace: 'organisms',
paths: ['source/_patterns/03-organisms'],
}, {
namespace: 'templates',
paths: ['source/_patterns/04-templates'],
}, {
namespace: 'pages',
paths: ['source/_patterns/05-pages'],
},
],
},
scssToJson: [
{
src: 'source/_patterns/00-base/01-colors/_color-vars.scss',
dest: 'source/_patterns/00-base/01-colors/colors.json',
lineStartsWith: '$c-',
allowVarValues: false,
},
{
src: 'source/_patterns/01-atoms/01-typography/fonts/_fonts.scss',
dest: 'source/_patterns/01-atoms/01-typography/fonts/font-sizes.json',
lineStartsWith: '$fs--',
allowVarValues: false,
},
{
src: 'source/_patterns/01-atoms/01-typography/fonts/_fonts.scss',
dest: 'source/_patterns/01-atoms/01-typography/fonts/font-families.json',
lineStartsWith: '$ff--',
allowVarValues: false,
},
{
src: 'source/_patterns/00-base/breakpoints/_breakpoints.scss',
dest: 'source/_patterns/00-base/breakpoints/breakpoints.json',
lineStartsWith: '$bp--',
allowVarValues: false,
},
{
src: 'source/_patterns/00-base/spacing/_spacing.scss',
dest: 'source/_patterns/00-base/spacing/spacing.json',
lineStartsWith: '$spacing--',
allowVarValues: false,
},
{
src: 'source/_patterns/00-base/animations/01-transitions/_transitions.scss',
dest: 'source/_patterns/00-base/animations/01-transitions/transitions.json',
lineStartsWith: '$trans-',
allowVarValues: true,
},
],
},
// https://github.com/nfroidure/gulp-iconfont
icons: {
enabled: true,
src: 'images/icons/src/*.svg',
dest: 'dest/',
fontPathPrefix: '',
classNamePrefix: 'icon',
autohint: false,
normalize: true,
templates: {
enabled: true,
css: {
src: 'images/icons/templates/_icons-settings.scss',
dest: 'source/_patterns/01-atoms/images/',
},
demo: {
src: 'images/icons/templates/icons.twig',
dest: 'source/_patterns/01-atoms/images/',
},
},
formats: [
'ttf',
'eot',
'woff',
'svg',
],
},
browserSync: {
enabled: true,
port: 3050,
watchFiles: [],
// enable when full CMS is set up
// domain: 'mysite.dev',
baseDir: './',
startPath: 'pattern-lab/public/',
openBrowserAtStart: false,
// requires above to be true; allows non-default browser to open
browser: [
'Google Chrome',
],
// Tunnel the Browsersync server through a random Public URL
// -> http://randomstring23232.localtunnel.me
tunnel: false,
reloadDelay: 50,
reloadDebounce: 750,
rewriteRules: [],
},
drupal: {
enabled: false,
themeFile: 'patternlab.info.yml',
// when these files change
watch: [
'templates/**',
],
// run this command
command: 'drush cc all',
// in this directory
dir: './',
},
};