-
Notifications
You must be signed in to change notification settings - Fork 34
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
Any hint on how to write hash in final file name? #65
Comments
Use the |
And how to "generate a hash name"? |
Here's how I do it (based on rollup's own implementation): import sha256 from 'hash.js/lib/hash/sha/256'
sass({
output: (style) => {
const hash = sha256().update(styles).digest('hex')
const fileName = `styles-${hash.substring(0, 8)}.css`
mkdirSync('path/to/output/dir', {recursive: true})
writeFileSync(`path/to/output/dir/${fileName}`, styles)
}
}) |
Moving to 'triaged' - For now the above solutions will suffice but we need to leverage rollup's existing lifecycle related config options ( |
Closing this ticket as both rollup-plugin-sass @frederikhors I know it's like 10 years later (:D) but If you're still facing the issue please feel free to reopen the ticket. |
@elycruz I breed horses today. 🤣 |
Any hint on how to write hash in final file name?
The text was updated successfully, but these errors were encountered: