-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
40 lines (34 loc) · 1.11 KB
/
Copy pathwebpack.config.js
File metadata and controls
40 lines (34 loc) · 1.11 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
/**
* External dependencies
*/
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
const path = require( 'path' );
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
module.exports = {
...defaultConfig,
entry: {
...defaultConfig.entry(),
// CSS files
'style': path.resolve( process.cwd(), 'assets/css/to-team.scss' ),
'admin': path.resolve( process.cwd(), 'assets/css/to-team-admin.scss' ),
// Block editor styles not covered by wp-scripts' automatic block.json
// entry detection (it only picks up JS fields like editorScript).
'blocks/social-links/editor': path.resolve( process.cwd(), 'src/blocks/social-links/editor.scss' ),
// JavaScript files
'admin-script': path.resolve( process.cwd(), 'assets/js/to-team-admin.js' ),
'frontend': path.resolve( process.cwd(), 'assets/js/to-team.js' ),
},
resolve: {
alias: {
'@utils': path.resolve( __dirname, 'src/utils/' ),
},
},
plugins: [
...defaultConfig.plugins,
new RemoveEmptyScriptsPlugin(),
],
output: {
...defaultConfig.output,
path: path.resolve( process.cwd(), 'build' ),
}
};