mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
fix(utils/dynamicRequire): pass moduleName explicitly as string
fixes the Webpack warning: "WARNING in ./src/public/app/services/utils.ts 249:15-34 Critical dependency: the request of a dependency is an expression" as we now explicitly pass the moduleName as string and not "expression" source: https://stackoverflow.com/questions/42908116/
This commit is contained in:
parent
9025516806
commit
d56752e5a9
@ -308,7 +308,9 @@ function dynamicRequire(moduleName: string) {
|
||||
if (typeof __non_webpack_require__ !== "undefined") {
|
||||
return __non_webpack_require__(moduleName);
|
||||
} else {
|
||||
return require(moduleName);
|
||||
// explicitly pass as string and not as expression to suppress webpack warning
|
||||
// 'Critical dependency: the request of a dependency is an expression'
|
||||
return require(`${moduleName}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user