-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
72 lines (69 loc) · 1.43 KB
/
config.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
import pkg from './package.json'
const config = {
src: 'src',
localUrl: `${pkg.name}.dev`
}
const tasks = {
cleanup: [
'./svgpack',
'./css',
'./js/bundle*.js'
],
css: {
processors: [
require('postcss-import'),
require('postcss-custom-properties'),
require('postcss-custom-media'),
require('postcss-apply'),
require('postcss-nesting'),
require('postcss-flexbugs-fixes'),
require('autoprefixer'),
require('postcss-browser-reporter')({
selector: 'body:before'
}),
require('postcss-reporter')({
clearMessages: true
})
],
minifyLib: require('csswring'),
src: [
`${config.src}/css/style.css`,
`${config.src}/css/editor-style.css`
],
dest: './'
},
webpack: {
src: `${config.src}/js/app.js`,
dest: './js',
filename: 'bundle.js'
},
images: {
src: `${config.src}/images/**/*`,
dest: './images'
},
svg: {
src: `${config.src}/svg/*.svg`,
dest: './svgpack'
},
svgRename: {
src: './svgpack/svgpack-sprite.svg',
dest: './template-parts',
filename: 'svgpack-sprite.php'
},
server: {
browserSyncOptions: {
proxy: config.localUrl,
open: 'external'
}
},
watch: {
css: [`${config.src}/css/**/*.css`],
webpack: [`${config.src}/js/**/*.js`],
reload: [
'./**/*.php',
'./js/*.js'
]
}
}
config.tasks = tasks
export default config