forked from cerner/terra-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
26 lines (21 loc) · 783 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
26 lines (21 loc) · 783 Bytes
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
const path = require('path');
const merge = require('webpack-merge');
const defaultWebpackConfig = require('terra-dev-site/config/webpack/webpack.config');
const coreConfig = () => {
const processPath = process.cwd();
const rootPath = processPath.includes('packages') ? processPath.split('packages')[0] : processPath;
const momentAlias = path.resolve(path.join(rootPath, 'packages', 'terra-date-time-picker', 'node_modules', 'moment'));
const i18nAlias = path.resolve(path.join(rootPath, 'packages', 'terra-i18n'));
return {
resolve: {
alias: {
moment: momentAlias,
'terra-i18n': i18nAlias,
},
},
};
};
const mergedConfig = (env, argv) => (
merge(defaultWebpackConfig(env, argv), coreConfig())
);
module.exports = mergedConfig;