mirror of https://github.com/embarklabs/embark.git
more DRY re: config
This commit is contained in:
parent
04fcb1510a
commit
35f92f2ae8
|
@ -50,13 +50,12 @@ class WebpackProcess extends ProcessWrapper {
|
||||||
let config, configPath;
|
let config, configPath;
|
||||||
try {
|
try {
|
||||||
if (fs.existsSync(dappConfigPath)) {
|
if (fs.existsSync(dappConfigPath)) {
|
||||||
delete require.cache[dappConfigPath];
|
|
||||||
configPath = dappConfigPath;
|
configPath = dappConfigPath;
|
||||||
config = require(dappConfigPath);
|
delete require.cache[configPath];
|
||||||
} else {
|
} else {
|
||||||
configPath = defaultConfigPath;
|
configPath = defaultConfigPath;
|
||||||
config = require(defaultConfigPath);
|
|
||||||
}
|
}
|
||||||
|
config = require(configPath);
|
||||||
// valid config types: https://webpack.js.org/configuration/configuration-types/
|
// valid config types: https://webpack.js.org/configuration/configuration-types/
|
||||||
// + function that returns a config object
|
// + function that returns a config object
|
||||||
// + function that returns a promise for a config object
|
// + function that returns a promise for a config object
|
||||||
|
|
Loading…
Reference in New Issue