forked from SAP/spartacus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextra-webpack.config.js
54 lines (49 loc) · 1.67 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
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: {
alias: {
'@spartacus/styles': path.join(__dirname, 'projects/storefrontstyles'),
'@spartacus/user': path.join(__dirname, 'feature-libs/user'),
'@spartacus/organization': path.join(
__dirname,
'feature-libs/organization'
),
'@spartacus/product': path.join(__dirname, 'feature-libs/product'),
'@spartacus/product-configurator': path.join(
__dirname,
'feature-libs/product-configurator'
),
'@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/tracking': path.join(__dirname, 'feature-libs/tracking'),
'@spartacus/cart': path.join(__dirname, 'feature-libs/cart'),
'@spartacus/order': path.join(__dirname, 'feature-libs/order'),
'@spartacus/epd-visualization': path.join(
__dirname,
'integration-libs/epd-visualization'
),
},
},
};