-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-config.js
98 lines (96 loc) · 2.1 KB
/
build-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
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
const host = 'https://flynt.test'
const dest = './dist'
function getCopyConfig (source) {
return {
from: source,
to: './',
noErrorOnMissing: true,
globOptions: {
ignore: [
'**/*.js',
'**/*.scss',
'**/*.php',
'**/*.twig',
'**/screenshot.png',
'**/README.md'
]
}
}
}
module.exports = {
webpack: {
entry: {
'assets/main': './assets/main.js',
'assets/admin': './assets/admin.js'
},
copy: {
patterns: [
getCopyConfig('./Components/**/*'),
getCopyConfig('./assets/**/*')
]
}
},
browserSync: {
ghostMode: false,
open: false,
proxy: {
target: host,
ws: false
},
watchOptions: {
ignoreInitial: true
},
injectChanges: true,
reloadDebounce: 1000,
ui: false,
files: [
'*.php',
'templates/**/*',
'lib/**/*',
'inc/**/*',
'./Components/**/*.{php,twig}'
],
watch: true,
https: true
},
webpackDevMiddleware: {
stats: false,
writeToDisk: true
},
gulp: {
dest: dest,
rev: {
src: dest + '/**/*.*',
srcRevved: [dest + '/**/*.{js,css}', '!' + dest + '/style.css'],
srcStatic: dest + '/**/*.{html,php,twig}',
assetSrc: [
dest + '/**/*',
'!' + dest + '/**/*+(css|js|json|html|php|twig|pot|md|htc|swf|xap)',
'!' + dest + '/style.css',
'!' + dest + '/screenshot.png',
'!' + dest + '/favicon.ico',
'!' + dest + '/favicon.png',
'!' + dest + '/apple-touch-icon-180x180.png',
'!' + dest + '/apple-touch-icon.png',
'!' + dest + '/**/screenshot.png'
],
revvedFileExtensions: ['.js', '.css'],
staticFileExtensions: ['.html', '.php', '.twig']
},
replaceVersion: {
wordpress: {
files: './style.css',
from: /Version: (.*)/gi,
to: 'Version: '
},
php: {
files: '!(node_modules|dist)/**/*.php',
from: '%%NEXT_VERSION%%'
},
js: {
files: '!(node_modules|dist)/**/*.js',
from: '%%NEXT_VERSION%%'
}
}
}
}