-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathwebpack.config.js
More file actions
79 lines (75 loc) · 1.87 KB
/
webpack.config.js
File metadata and controls
79 lines (75 loc) · 1.87 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
69
70
71
72
73
74
75
76
77
78
79
/**
* WordPress dependencies
*/
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
/**
* External dependencies
*/
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
const path = require( 'path' );
// Extend the default webpack config.
module.exports = {
...defaultConfig,
entry: {
...defaultConfig.entry(),
'admin/settings': path.resolve(
process.cwd(),
'src/admin/settings',
'index.scss'
),
'experiments/abilities-explorer': path.resolve(
process.cwd(),
'src/experiments/abilities-explorer',
'index.js'
),
'experiments/example-experiment': path.resolve(
process.cwd(),
'src/experiments/example-experiment',
'index.tsx'
),
'experiments/excerpt-generation': path.resolve(
process.cwd(),
'src/experiments/excerpt-generation',
'index.tsx'
),
'experiments/image-generation': path.resolve(
process.cwd(),
'src/experiments/image-generation',
'index.ts'
),
'experiments/review-notes': path.resolve(
process.cwd(),
'src/experiments/review-notes',
'index.tsx'
),
'experiments/summarization': path.resolve(
process.cwd(),
'src/experiments/summarization',
'index.tsx'
),
'experiments/title-generation': path.resolve(
process.cwd(),
'src/experiments/title-generation',
'index.tsx'
),
'experiments/alt-text-generation': path.resolve(
process.cwd(),
'src/experiments/alt-text-generation',
'index.tsx'
),
'experiments/alt-text-generation-media': path.resolve(
process.cwd(),
'src/experiments/alt-text-generation',
'media.ts'
),
},
plugins: [
// Include WP's plugin config.
...defaultConfig.plugins,
// Removes the empty `.js` files generated by webpack but
// sets it after WP has generated its `*.asset.php` file.
new RemoveEmptyScriptsPlugin( {
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
} ),
],
};