Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack "Critical dependency: the request of a dependency is an expression" #158

Open
mooshee opened this issue Mar 30, 2017 · 0 comments
Open

Comments

@mooshee
Copy link

mooshee commented Mar 30, 2017

The offending line is a require of the commands in the commands dir using string concatenation. Is there any reason they aren't hard coded? Seems like laziness to me, but perhaps there's another reason it was done this way.

The warning from webpack.

WARNING in ./~/osmosis/lib/Command.js
    542:18-40 Critical dependency: the request of a dependency is an expression

The offending code

fs.readdirSync(cmdDir).forEach(function (file) {
    var command = require(cmdDir + file);  // WARNING - Line 542

    if (typeof command === 'object') {
        Object.keys(command).forEach(function (name) {
            contextCommand(name, command[name]);
        });
    } else {
        runtimeCommand(file.substr(0, file.length - 3), command);
    }
});
Wassasin added a commit to Wassasin/node-osmosis that referenced this issue Oct 19, 2018
Wassasin added a commit to Wassasin/node-osmosis that referenced this issue Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant