forked from GatherPress/gatherpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·46 lines (44 loc) · 1.13 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
41
42
43
44
45
46
/**
* External Dependencies
*/
const path = require('path');
/**
* WordPress Dependencies
*/
const defaultConfig = require('@wordpress/scripts/config/webpack.config.js');
module.exports = {
...defaultConfig,
entry: {
...defaultConfig.entry(),
admin_style: path.resolve(process.cwd(), 'src', 'admin.scss'),
editor: path.resolve(process.cwd(), 'src', 'editor.js'),
panels: path.resolve(process.cwd(), 'src/panels', 'index.js'),
modals: path.resolve(process.cwd(), 'src/modals', 'index.js'),
settings: path.resolve(process.cwd(), 'src/settings', 'index.js'),
settings_style: path.resolve(
process.cwd(),
'src/settings',
'style.scss'
),
profile: path.resolve(process.cwd(), 'src/profile', 'index.js'),
profile_style: path.resolve(process.cwd(), 'src/profile', 'style.scss'),
},
module: {
...defaultConfig.module,
rules: [
...defaultConfig.module.rules.filter(
(rule) =>
!/\.(bmp|png|jpe?g|gif|webp)$/i.test(rule.test.toString())
),
...[
{
test: /\.(bmp|png|jpe?g|gif|webp)$/i,
type: 'asset/resource',
generator: {
filename: 'images/[name][ext]',
},
},
],
],
},
};