1

I am trying to migrate from grunt to webpack in a backbone/coffeescript project. While bundling, I'm getting error Cannot statically analyse 'require(…, …)' for require statement in which dependencies are known at run time. To handle above, I'm using webpack ContextReplacementPlugin.

Below is code snippet-

 dependencies.push('modules/' + key + '/Module')
 require(dependencies,()->
              for i in [0..dependencies.length-1] 
              .......
              ......

and my webpack.config.js has following configuration:

new ContextReplacementPlugin(/^\/modules\/.*\/Module/)

0 Answers0