-
Notifications
You must be signed in to change notification settings - Fork 388
/
extra-webpack.config.js
80 lines (75 loc) · 2.73 KB
/
extra-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
const webpack = require('webpack');
const path = require('path');
const keyPrefix = 'CX_';
const env = {};
const keys = Object.keys(process.env).filter((key) =>
key.startsWith(keyPrefix)
);
keys.forEach((key) => {
const value = process.env[key];
env[key] = value === 'true' ? true : value === 'false' ? false : value;
});
console.log('env=', env);
module.exports = {
plugins: [
new webpack.DefinePlugin({
'buildProcess.env': JSON.stringify(env),
}),
],
resolve: {
fallback: {
'@spartacus/styles': path.join(__dirname, 'projects/storefrontstyles'),
'@spartacus/user': path.join(__dirname, 'feature-libs/user'),
'@spartacus/organization': path.join(
__dirname,
'feature-libs/organization'
),
'@spartacus/pdf-invoices': path.join(
__dirname,
'feature-libs/pdf-invoices'
),
'@spartacus/product': path.join(__dirname, 'feature-libs/product'),
'@spartacus/product-configurator': path.join(
__dirname,
'feature-libs/product-configurator'
),
'@spartacus/product-multi-dimensional': path.join(__dirname, 'feature-libs/product-multi-dimensional'),
'@spartacus/storefinder': path.join(
__dirname,
'feature-libs/storefinder'
),
'@spartacus/checkout': path.join(__dirname, 'feature-libs/checkout'),
'@spartacus/asm': path.join(__dirname, 'feature-libs/asm'),
'@spartacus/smartedit': path.join(__dirname, 'feature-libs/smartedit'),
'@spartacus/qualtrics': path.join(__dirname, 'feature-libs/qualtrics'),
'@spartacus/requested-delivery-date': path.join(
__dirname,
'feature-libs/requested-delivery-date'
),
'@spartacus/estimated-delivery-date': path.join(
__dirname,
'feature-libs/estimated-delivery-date'
),
'@spartacus/tracking': path.join(__dirname, 'feature-libs/tracking'),
'@spartacus/cart': path.join(__dirname, 'feature-libs/cart'),
'@spartacus/order': path.join(__dirname, 'feature-libs/order'),
'@spartacus/quote': path.join( __dirname, 'feature-libs/quote'),
'@spartacus/epd-visualization': path.join(
__dirname,
'integration-libs/epd-visualization'
),
'@spartacus/customer-ticketing': path.join(
__dirname,
'feature-libs/customer-ticketing'
),
'@spartacus/pickup-in-store': path.join(
__dirname,
'feature-libs/pickup-in-store'
),
'@spartacus/s4om': path.join(__dirname, 'integration-libs/s4om'),
'@spartacus/opf': path.join(__dirname, 'integration-libs/opf'),
'@spartacus/s4-service': path.join(__dirname, 'integration-libs/s4-service'),
'@spartacus/omf': path.join(__dirname, 'integration-libs/omf'),
},
},
};