Webpack 2.x cannot extract the emmet package (while Webpack 1.x is fine with the same package)

Do you want to request a feature or report a bug?

I believe this is a bug.

What is the current behavior?

Webpack 2.x refuses to extract a package while Webpack 1.x is completely fine extracting the same package.

Webpack 2.5.1 gave me the following error:

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

If the current behavior is a bug, please provide the steps to reproduce.

A file with require('emmet') will be processed normally with Webpack 1.x but it will give the error above with Webpack 2.x

What is the expected behavior?

Webpack 2.x should extract the emmet library fine just like Webpack 1.x does. There is nothing wrong with how the require function is used in the emmet package.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

I have tested this with Node 7.9, Webpack 1.15.0, and Webpack 2.5.1

Author: Fantashit

1 thought on “Webpack 2.x cannot extract the emmet package (while Webpack 1.x is fine with the same package)

Comments are closed.