Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62731ed

Browse files
clodalkoskimas
authored andcommitted
Add comments about dependency expression warning
1 parent be60eb5 commit 62731ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/utils/resolveModel.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ function requireUsingModelPaths(modelRef, modelPaths) {
5353

5454
function requireModel(modelPath) {
5555
const Model = getModel();
56-
56+
/**
57+
* Wrap path string in template literal to prevent
58+
* warnings about Objection.JS being an expression
59+
* in webpack builds.
60+
* @link https://github.com/webpack/webpack/issues/196
61+
*/
5762
let mod = require(`${path.resolve(modelPath)}`);
5863
let modelClass = null;
5964

0 commit comments

Comments
 (0)