-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support extends for the Webpack configuration object in webpack.project
- Loading branch information
1 parent
9093fa5
commit f86cd0f
Showing
3 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
const path = require('path'); | ||
|
||
const CONFIG = require('./../../webpack.project'); | ||
const WEBPACK_CONFIG_BASE = path.resolve(__dirname, './webpack.config.base.js'); | ||
|
||
CONFIG.webpack.extends = path.join(__dirname, './webpack.config.base.js'); | ||
if (typeof CONFIG.webpack.extends === 'string') { | ||
// Convert string into array so we can apply our base config | ||
CONFIG.webpack.extends = [CONFIG.webpack.extends]; | ||
} | ||
|
||
CONFIG.webpack.extends = CONFIG.webpack.extends || []; | ||
CONFIG.webpack.extends.push(WEBPACK_CONFIG_BASE); | ||
|
||
module.exports = CONFIG.webpack; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters