We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I forked the loader to customize it for our codebase and to add HMR and thought you might find it useful:
module.exports.pitch = function(remainingRequest) { this.cacheable() var cnames = loaderUtils.stringifyRequest(this, "!" + require.resolve("classnames/bind")) var styles = loaderUtils.stringifyRequest(this, "!!" + remainingRequest) return ` if (module.hot) { var styles = require(${ styles }) var classnames = require(${ cnames }).bind(styles) var fn = function() { return classnames.apply(null, arguments) } // Allow using this as an ES6 module fn.default = fn // Allow access to the raw style map fn.styles = styles module.exports = fn module.hot.accept(${ styles }, function() { fn.styles = styles = require(${ styles }) classnames = require(${ cnames }).bind(styles) }) } else { module.exports = require(${ cnames }).bind(require(${ styles })) } `; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I forked the loader to customize it for our codebase and to add HMR and thought you might find it useful:
The text was updated successfully, but these errors were encountered: