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

Invalid hashes of commons chunks because hash is not generated from purgecss result #40

Open
StarpTech opened this issue Nov 21, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@StarpTech
Copy link

StarpTech commented Nov 21, 2019

@lucleray I don't know if it's related to next-compose-plugins but when I use this plugin the hash of the generated common chunks is wrong.

module.exports = withPlugins(
  [
    withCSS,
    [
      withSass,
      {
        sassLoaderOptions: {
          includePaths: ['../../node_modules', 'node_modules', 'styles']
        }
      }
    ],
    [
      optional(() => withPurgeCss),
      {
        purgeCssPaths: ['pages/**/*', 'components/**/*', 'layouts/**/*'],
        purgeCss: {
          whitelist: ['__next']
        }
      },
      [PHASE_PRODUCTION_BUILD]
    ]
  ]
)

Reproduce

  1. Use a class like pt-xl-4 in exact one component. PurgeCss will include it because it's used. The hash of the file is something like .next/static/chunks/commons.d4d0b807.chunk.css.
  2. Remove the class pt-xl-4 in the component and rebuild. You will see the hash hasn't changed but the class was removed by PurgeCss.

That's an indication that hash was generated on the content before purgecss proceed it.

We removed it completely from the build because it was the cause of several production cache issues.

@lucleray
Copy link
Owner

lucleray commented Nov 22, 2019

Hi!

Thanks for reporting. This seems to be an upstream issue with purgecss-webpack-plugin:
FullHuman/purgecss-webpack-plugin#65

I'll leave this issue open so we can track the progress there and update this plugin when it's solved.

@lucleray lucleray added the bug Something isn't working label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants