-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
executable file
·40 lines (38 loc) · 1.41 KB
/
webpack.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
const path = require( 'path' )
const BrowserSyncPlugin = require( 'browser-sync-webpack-plugin' )
// @wordpress/scripts config.
const wordpressConfig = require( '@wordpress/scripts/config/webpack.config' )
// @wordpress/scripts helper which generates entry points from any '**/block.json' in 'src'.
const { getWebpackEntryPoints } = require( '@wordpress/scripts/utils/config' )
// See svgo.config.js to configure SVG manipulation.
module.exports = {
...wordpressConfig,
entry: {
// Everything outputs to build/.
...getWebpackEntryPoints(),
// 'example/output': './path/to/dir/entrypoint.js'
'css/bigup-contact-form-public': path.join( __dirname, '/src/css/form.scss' ),
'css/bigup-contact-form-admin': path.join( __dirname, '/src/css/admin.scss' ),
'js/bigup-contact-form-public': path.join( __dirname, '/src/js/view-public.js' ),
'js/bigup-contact-form-admin': path.join( __dirname, '/src/js/view-admin.js' ),
},
plugins: [
...wordpressConfig.plugins,
new BrowserSyncPlugin( {
proxy: 'localhost:8001', // Live WordPress site. Using IP breaks it.
ui: { port: 3001 }, // BrowserSync UI.
port: 3000, // Dev port on localhost.
logLevel: 'debug',
reload: false, // false = webpack handles reloads (not sure if this works with files option).
browser: "google-chrome-stable",
files: [
'src/**',
'classes/**',
'patterns/**',
'parts/**',
'templates/**',
'**/**.json'
]
} )
]
}