forked from elementor/one-click-accessibility
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
68 lines (65 loc) · 1.43 KB
/
webpack.config.js
File metadata and controls
68 lines (65 loc) · 1.43 KB
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
const path = require('path');
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
// add your entry points here
const entryPoints = {
admin: path.resolve(process.cwd(), 'modules/settings/assets/js', 'admin.js'),
};
// React JSX Runtime Polyfill
const reactJSXRuntimePolyfill = {
entry: {
'react-jsx-runtime': {
import: 'react/jsx-runtime',
},
},
output: {
path: path.resolve(__dirname, 'assets/lib'),
filename: 'react-jsx-runtime.js',
library: {
name: 'ReactJSXRuntime',
type: 'window',
},
},
externals: {
react: 'React',
},
};
module.exports = [
{
...defaultConfig,
entry: entryPoints,
output: {
...defaultConfig.output,
path: path.resolve(process.cwd(), 'assets/build'),
},
resolve: {
alias: {
'@ea11y/hooks': path.resolve(
__dirname,
'modules/settings/assets/js/hooks/',
),
'@ea11y/components': path.resolve(
__dirname,
'modules/settings/assets/js/components/',
),
'@ea11y/icons': path.resolve(
__dirname,
'modules/settings/assets/js/icons/',
),
'@ea11y/layouts': path.resolve(
__dirname,
'modules/settings/assets/js/layouts/',
),
'@ea11y/pages': path.resolve(
__dirname,
'modules/settings/assets/js/pages/',
),
'@ea11y/services': path.resolve(
__dirname,
'modules/settings/assets/js/services',
),
},
extensions: ['.js', '.jsx'],
},
},
reactJSXRuntimePolyfill,
];