-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (40 loc) · 1.51 KB
/
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
46
47
const path = require( 'path' );
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
// 'list/mhwp-ipso-list-frontend': './mhwp-ipso/blocks/list/mhwp-ipso-list-frontend.js',
// 'button/mhwp-ipso-button-frontend': './mhwp-ipso/blocks/button/mhwp-ipso-button-frontend.js',
// 'list/mhwp-ipso-list': './mhwp-ipso/blocks/list/',
// 'button/mhwp-ipso-button': './mhwp-ipso/blocks/button/',
module.exports = {
...defaultConfig,
entry: {
'list/mhwp-ipso-list': './mhwp-ipso/blocks/list/',
'list/mhwp-ipso-list-frontend': './mhwp-ipso/blocks/list/mhwp-ipso-list-frontend.ts',
'button/mhwp-ipso-button': './mhwp-ipso/blocks/button/',
'button/mhwp-ipso-button-frontend': './mhwp-ipso/blocks/button/mhwp-ipso-button-frontend.ts',
},
output: {
path: path.resolve( __dirname ) + '/mhwp-ipso/blocks/dist',
filename: '[name].js'
},
module: {
...defaultConfig.module,
rules: [
...defaultConfig.module.rules,
{
test: /\.tsx?/,
use: [
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.json',
transpileOnly: false
}
}
]
}
]
},
resolve: {
extensions: ['.ts', '.tsx', ...(defaultConfig.resolve ? defaultConfig.resolve.extensions || ['.js', '.jsx'] : [])]
}
};