forked from DataBiosphere/terra-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
33 lines (30 loc) · 1.02 KB
/
config-overrides.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
const { execSync } = require('child_process')
const webpack = require('webpack')
const _ = require('lodash/fp')
const path = require('path')
const rewireReactHotLoader = require('react-app-rewire-hot-loader')
const {useEslintRc} = require('customize-cra')
const manualOverrides = require('./webpack.config')
/* config-overrides.js */
module.exports = {
webpack: function(config, env) {
config = useEslintRc()(config)
config = _.merge(config, manualOverrides)
config.module.rules[2].oneOf.unshift(
{
include: [path.resolve(__dirname, 'src/icons')],
loader: 'raw-loader'
}
)
config.plugins.push(new webpack.DefinePlugin({
SATURN_VERSION: JSON.stringify(execSync('git rev-parse HEAD').toString().trim()),
SATURN_BUILD_TIMESTAMP: JSON.stringify(Date.now())
}))
return rewireReactHotLoader(config, env)
},
jest: function(config) {
return _.merge(config, {
moduleDirectories: ['node_modules', ''] // to allow Jest to resolve absolute module paths
})
}
}