-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (40 loc) · 959 Bytes
/
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
/**
* WordPress dependencies
*/
const baseConfiguration = require( '@wordpress/scripts/config/webpack.config' );
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
/**
* External dependencies
*/
const path = require( 'path' );
module.exports = {
...baseConfiguration,
entry: {
main: './sources/client/src/index.ts',
logging: './sources/client/src/logging/index.ts',
},
plugins: [
...baseConfiguration.plugins.filter(
( plugin ) =>
plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
),
new DependencyExtractionWebpackPlugin( {
outputFormat: 'php',
} ),
],
resolve: {
...baseConfiguration.resolve,
alias: {
...baseConfiguration.resolve.alias,
'@types': path.resolve( __dirname, './@types/index.d.ts' ),
},
},
output: {
...baseConfiguration.output,
filename: '[name].js',
library: {
name: 'wpEntitiesSearch',
type: 'window',
},
},
};