-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (43 loc) · 962 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
42
43
44
45
/**
* External dependencies
*/
const path = require('path')
/**
* WordPress dependencies
*/
const baseConfiguration = require('@wordpress/scripts/config/webpack.config')
const DependencyExtractionWebpackPlugin = require('@wordpress/dependency-extraction-webpack-plugin')
/**
* Internal dependencies
*/
const tsConfig = require('./tsconfig.json')
const makeAliases = require('./.scripts/make-aliases')
const configuration = {
...baseConfiguration,
plugins: [
...baseConfiguration.plugins.filter((plugin) => {
return (
plugin.constructor.name !==
'DependencyExtractionWebpackPlugin' &&
plugin.constructor.name !== 'CopyPlugin'
)
}),
new DependencyExtractionWebpackPlugin({
outputFormat: 'php',
}),
],
resolve: {
...baseConfiguration.resolve,
alias: makeAliases(baseConfiguration.resolve.alias, tsConfig, __dirname),
},
output: {},
}
module.exports = [
{
...configuration,
entry: {
},
output: {
},
},
]