Skip to content
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

Remove check for filenameTemplate #159

Merged
merged 1 commit into from May 2, 2018

Conversation

Projects
None yet
4 participants
@claus
Copy link
Contributor

claus commented May 2, 2018

This broke commons-chunk-config in Next 6.

Helps to fix #157

Remove check for filenameTemplate
This broke commons-chunk-config in Next 6.
@@ -3,16 +3,18 @@ module.exports = (config, test = /\.css$/) => {
config.plugins = config.plugins.map(plugin => {
if (
plugin.constructor.name === 'CommonsChunkPlugin' &&
(plugin.filenameTemplate === 'commons.js' || plugin.filenameTemplate === 'main.js')
typeof plugin.minChunks !== 'undefined'

This comment has been minimized.

@timneutkens

timneutkens May 2, 2018

Member

Lets keep the existing check, since otherwise this breaks 5.0/5.1

This comment has been minimized.

@claus

claus May 2, 2018

Author Contributor

Heh, but the existing check is what breaks 6

This comment has been minimized.

@timneutkens

timneutkens May 2, 2018

Member

We need to do both checks in an or

This comment has been minimized.

@claus

claus May 2, 2018

Author Contributor

Like this? plugin.constructor.name === 'CommonsChunkPlugin' && (plugin.filenameTemplate === 'commons.js' || plugin.filenameTemplate === 'main.js' || typeof plugin.minChunks !== 'undefined')

This comment has been minimized.

@claus

claus May 2, 2018

Author Contributor

Doesn't feel right :)

This comment has been minimized.

@claus

claus May 2, 2018

Author Contributor

Are you sure the removal breaks 5?

This comment has been minimized.

@claus

claus May 2, 2018

Author Contributor

I just tested it in Next 5.1 and it didn't seem to break it. Why exactly do you check for commons.js or main.js?

@timneutkens
Copy link
Member

timneutkens left a comment

Actually this will work backwards compatible too.

@timneutkens timneutkens merged commit 084a985 into zeit:master May 2, 2018

@visualfanatic

This comment has been minimized.

Copy link

visualfanatic commented May 2, 2018

Thank you @claus for the fix! 👍

@RobbinHabermehl

This comment has been minimized.

Copy link

RobbinHabermehl commented May 7, 2018

This PR resolves our issues as well, thanks @claus!

@timneutkens, could you please publish this to NPM and also bump the dependency in @zeit/next-sass? Thanks!

@timneutkens

This comment has been minimized.

Copy link
Member

timneutkens commented May 9, 2018

Released the new versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.