forked from woocommerce/woocommerce-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
96 lines (87 loc) · 1.83 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
* Internal dependencies
*/
const { NODE_ENV, getAlias } = require( './bin/webpack-helpers.js' );
const {
getCoreConfig,
getMainConfig,
getFrontConfig,
getPaymentsConfig,
getExtensionsConfig,
getStylingConfig,
getInteractivityAPIConfig,
} = require( './bin/webpack-configs.js' );
// Only options shared between all configs should be defined here.
const sharedConfig = {
mode: NODE_ENV,
performance: {
hints: false,
},
stats: {
all: false,
assets: true,
builtAt: true,
colors: true,
errors: true,
hash: true,
timings: true,
},
watchOptions: {
ignored: /node_modules/,
},
devtool: NODE_ENV === 'development' ? 'source-map' : false,
};
// Core config for shared libraries.
const CoreConfig = {
...sharedConfig,
...getCoreConfig( { alias: getAlias() } ),
};
// Main Blocks config for registering Blocks and for the Editor.
const MainConfig = {
...sharedConfig,
...getMainConfig( {
alias: getAlias(),
} ),
};
// Frontend config for scripts used in the store itself.
const FrontendConfig = {
...sharedConfig,
...getFrontConfig( { alias: getAlias() } ),
};
/**
* Config for building experimental extension scripts.
*/
const ExtensionsConfig = {
...sharedConfig,
...getExtensionsConfig( { alias: getAlias() } ),
};
/**
* Config for building the payment methods integration scripts.
*/
const PaymentsConfig = {
...sharedConfig,
...getPaymentsConfig( { alias: getAlias() } ),
};
/**
* Config to generate the CSS files.
*/
const StylingConfig = {
...sharedConfig,
...getStylingConfig( { alias: getAlias() } ),
};
/**
* Config to generate the Interactivity API runtime.
*/
const InteractivityConfig = {
...sharedConfig,
...getInteractivityAPIConfig( { alias: getAlias() } ),
};
module.exports = [
CoreConfig,
MainConfig,
FrontendConfig,
ExtensionsConfig,
PaymentsConfig,
StylingConfig,
InteractivityConfig,
];