-
Notifications
You must be signed in to change notification settings - Fork 19
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
Not working with webpack@^5.0.0 #52
Comments
@ayxos
Not sure if this is the best approach, but I solved this just a webpack 5 changelog offers to: module.exports = function (config) {
if (typeof this.cacheable === 'function') {
this.cacheable();
}
+ var exec = function(code, filename) {
+ var _module = new NativeModule(filename, this);
+ _module.paths = NativeModule._nodeModulePaths(this.context);
+ _module.filename = filename;
+ _module._compile(code, filename);
+ return _module.exports;
+ }
+ exec = exec.bind(this);
var cb = this.async();
- modernizr.build(this.exec(config, this.resource), function (output) {
+ modernizr.build(exec(config, this.resource), function (output) {
cb(null, wrapOutput(output));
});
};
P.S. You should also add |
This solution worked for me. Looks as though this project is dead, but I don't see a decent alternative. |
I ran into this issue as well. All Webpack loaders and plugins that handle Modernizr builds don't seem to be updated for Webpack 5 or are no longer maintained at all anymore. There's a guide within the official Webpack documentation on how to set this up with |
I was able to solve my issue by removing Here's an example that I'm using to style on touch devices @media (hover: none) {
a {
background: yellow; /* Example touch only style */
}
} https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover |
Looks like there's a working fork here: https://github.com/sectsect/modernizr-loader. |
The new webpack version is not compatible with this loader, the compiler throws
Any idea why?
The text was updated successfully, but these errors were encountered: