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

Calc a hash from generated code #3

Merged
merged 1 commit into from
Sep 14, 2018

Conversation

tetsuharuohzeki
Copy link
Contributor

By this change, this plugin can calc a hash correctly even if only a "node" css file gathered by postcss is changed.

Fix #2

By this change, this plugin can calc a hash correctly
even if only a "node" css file gathered by postcss is changed.
@tetsuharuohzeki
Copy link
Contributor Author

@dacodekid how do you think about this?

@keithamus keithamus merged commit 4fe65c3 into keithamus:master Sep 14, 2018
@keithamus
Copy link
Owner

Thanks for your work here @saneyuki! Sorry for the delay in merging.

@tetsuharuohzeki tetsuharuohzeki deleted the generate-hash branch September 18, 2018 04:43
@brycewray
Copy link

brycewray commented Dec 8, 2020

I still observe the same behavior noted in #2. Is it dependent on the order in which this plugin is loaded in postcss.config.js (example below)? I tried it as the first item and see this behavior. I tried it as the last item and glitchy builds result online, despite good local test results.

const path = require('path')

module.exports = {
  plugins: [
    require('postcss-hash')({
      // algorithm: "sha512", // default = "md5"
      trim: 20,
      manifest: './_data/manifest.json',
      name: ({dir, name, hash, ext}) => path.join(dir, name + '-' + hash + ext)
    }),
    require('postcss-import'),
    require('tailwindcss'),
    require('postcss-preset-env')({ stage: 1 }),
    require('postcss-clean'),
  ],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants