-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix #88 Breaks with mini-css-extract-plugin@1.3.0 #89
Conversation
e0be140
to
e22c043
Compare
lib/SvgStorePlugin.js
Outdated
case 'CssModule': { | ||
const content = sprite.replacePathsWithInterpolatedPaths(module.content.toString()); | ||
|
||
if (Buffer.isBuffer(module.content)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be an else if (typeof module.content === 'string')
here? I'm guessing the update would break those using an older version of mini-css-extract-plugin? I don't use this SVG path in CSS myself but just noticed it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, thanks for checking! That was my intention and then I ended up doing it wrong 😅
Should be fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I released it as 7.1.0-beta.2. Can you let me know if this still works for you just as a sanity check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it works in my repro repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll merge it and release it as 7.1.0 then :)
* Convert the `CssModule` content to string in order to be able to replace the Sprite URL. * Convert the `CssModule` content back to `Buffer` if it was a buffer before so that the plugin remains compatible with older versions of `CssModule`. * Change from `[hash]` to `[contenthash]` since this is now the recommended way of generating hashes and because this should also result in less filename changes. * Update the `react` example installation so that it uses hashes in order to no longer cache assets.
* Convert the `CssModule` content back to the original format so that the plugin remains compatible all versions of `CssModule`.
b2b4a3e
to
6d9e14a
Compare
CssModule
content to string in order to be able to replace the Sprite URL.CssModule
content back toBuffer
if it was a buffer before so that the plugin remains compatible with older versions ofCssModule
.[hash]
to[contenthash]
since this is now the recommended way of generating hashes and because this should also result in less filename changes.react
example installation so that it uses hashes in order to no longer cache assets.