-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support additional source paths and entries in webpack build
- Loading branch information
1 parent
04d3205
commit 68f2ea8
Showing
13 changed files
with
84 additions
and
15 deletions.
There are no files selected for viewing
Submodule gui-elements
updated
6 files
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
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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Build utility functions that are shared among multiple files. | ||
**/ | ||
const paths = require("../config/paths"); | ||
|
||
const adaptWebpackConfig = (config) => { | ||
let adaptedConf = {...config} | ||
if (paths.additionalSourcePaths().length > 0 || paths.additionalEntries().length > 0) { | ||
paths.additionalEntries().length > 0 && console.log("Add additional entry point/s: " + paths.additionalEntries().join(", ")) | ||
adaptedConf.entry = adaptedConf.entry.concat(paths.additionalEntries()) | ||
paths.additionalSourcePaths().length > 0 && adaptedConf.module.rules.forEach(rule => { | ||
if (Array.isArray(rule.include)) { | ||
console.log("Adding additional source path/s: " + paths.additionalSourcePaths().join(", ")) | ||
rule.include = rule.include.concat(paths.additionalSourcePaths()) | ||
} | ||
if (rule.oneOf) { | ||
rule.oneOf.forEach(oneOfRule => { | ||
if (Array.isArray(oneOfRule.include)) { | ||
console.log("Adding additional source path/s to module: " + oneOfRule.loader) | ||
oneOfRule.include = oneOfRule.include.concat(paths.additionalSourcePaths()) | ||
} | ||
}) | ||
} | ||
}) | ||
} | ||
return adaptedConf | ||
} | ||
|
||
module.exports = { | ||
adaptWebpackConfig | ||
} |
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
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