forked from woocommerce/woocommerce-gateway-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (43 loc) · 1.33 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
const path = require( 'path' );
const webpack = require( 'webpack' );
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const DependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
module.exports = {
...defaultConfig,
optimization: {
...defaultConfig.optimization,
splitChunks: undefined,
},
plugins: [
...defaultConfig.plugins.filter(
( plugin ) =>
plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
),
new DependencyExtractionWebpackPlugin( {
injectPolyfill: true,
} ),
new webpack.DefinePlugin( {
__PAYMENT_METHOD_FEES_ENABLED: JSON.stringify(
process.env.PAYMENT_METHOD_FEES_ENABLED === 'true'
),
} ),
],
resolve: {
extensions: [ '.json', '.js', '.jsx' ],
modules: [ path.join( __dirname, 'client' ), 'node_modules' ],
alias: {
wcstripe: path.resolve( __dirname, 'client' ),
},
},
entry: {
index: './client/blocks/index.js',
old_settings_upe_toggle:
'./client/entrypoints/old-settings-upe-toggle/index.js',
payment_requests_settings:
'./client/entrypoints/payment-request-settings/index.js',
upe_classic: './client/classic/upe/index.js',
upe_blocks: './client/blocks/upe/index.js',
upe_settings: './client/settings/index.js',
payment_gateways: './client/entrypoints/payment-gateways/index.js',
},
};