-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
51 lines (42 loc) · 1.13 KB
/
webpack.config.js
File metadata and controls
51 lines (42 loc) · 1.13 KB
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
const { cmsConfig } = require('@hs-web-team/webpack-config');
const { merge } = require('webpack-merge');
const path = require('path');
const modes = {
DEVELOPMENT: 'development',
QA: 'qa',
PRODUCTION: 'production',
};
const customConfig = {
// Add your custom config settings here
};
module.exports = (_, args) => {
if (args.mode === modes.DEVELOPMENT) {
const devConfig = cmsConfig({
projectFolder: path.resolve(__dirname),
portal: 'DEV',
cmsSrc: 'dist',
cmsDest: 'sample-site',
autoupload: true,
});
return merge(devConfig, customConfig);
}
if (args.mode === modes.QA) {
const prodConfig = cmsConfig({
projectFolder: path.resolve(__dirname),
portal: 'QA',
cmsSrc: 'dist',
cmsDest: 'sample-site',
});
return merge(prodConfig, customConfig);
}
if (args.mode === modes.PRODUCTION) {
const prodConfig = cmsConfig({
projectFolder: path.resolve(__dirname),
portal: 'PROD',
cmsSrc: 'dist',
cmsDest: 'sample-site',
});
return merge(prodConfig, customConfig);
}
throw new Error('Error: no webpack mode specified.');
};