Tuesday 23 May 2017

Webpack for backend: the request of a dependency is an expression

Trying to follow this tutorial for using webpack for the backend I have successfully build the bundle, unfortunately on completion it warnsCritical dependency: the request of a dependency is an expression, I used webpack-node-externals module to externalize the whole node_modules directory but I need to dynamically require some modules from node_modules but webpack replaces my require with an error. Apparently there's a way to tell webpack to leave alone those requires that cannot resolve but it warns webpack: Using compiler.parser is deprecated, apparently that way of creating an inline plugin has been deprecated but I'm not able to translate that to the new syntax which should be:

compiler.plugin("compilation", function(compilation, params) {
  params.normalModuleFactory.plugin("parser", function(parser, parserOptions) {
    parser.plugin(/* ... */);
  });
});

According to this. Any help is appreciated.



via EHR

No comments:

Post a Comment