-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbud.config.js
52 lines (48 loc) · 1.32 KB
/
bud.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
/**
* Compiler configuration
*
* @see {@link https://roots.io/sage/docs sage documentation}
* @see {@link https://bud.js.org/learn/config bud.js configuration guide}
*
* @type {import('@roots/bud').Config}
*/
export default async (app) => {
app.alias('@modules', app.path('node_modules'))
/**
* Application assets & entrypoints
*
* @see {@link https://bud.js.org/reference/bud.entry}
* @see {@link https://bud.js.org/reference/bud.assets}
*/
app
.entry('app', ['@scripts/app', '@styles/app'])
.entry('admin', ['@scripts/admin', '@styles/admin'])
.assets(['images']);
app.splitChunks({
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]|src[\\/]assets[\\/]scripts[\\/]libs/,
name: 'vendor',
enforce: true,
chunks: 'all',
},
},
});
/**
* Set public path
*
* @see {@link https://bud.js.org/reference/bud.setPublicPath}
*/
app.setPublicPath('/wp-content/themes/THEME_PUBLIC_PATH_NAME/public/');
/**
* Development server settings
*
* @see {@link https://bud.js.org/reference/bud.setUrl}
* @see {@link https://bud.js.org/reference/bud.setProxyUrl}
* @see {@link https://bud.js.org/reference/bud.watch}
*/
app
.setUrl('http://localhost:3000')
.setProxyUrl(process.env.WP_HOME)
.watch(['resources/views', 'app']);
};