Open frankieyan opened 3 years ago
I'm trying to generate classnames similar to webpack's localIdentName where its default is a single hash: https://webpack.js.org/loaders/css-loader/#localidentname
localIdentName
With a single hash token provided to generateScopedName, it looks like it's generated off of the file name and the entire contents of the css file, so every classname within the same document will receive the same hash:
hash
generateScopedName
https://github.com/Anidetrix/rollup-plugin-styles/blob/5e877a862c9b349b8714dff8b61a8c8fbf64a775/src/loaders/postcss/modules/generate.ts#L15
Would it make sense to use something like hasher(`${base}:${css}:${local}`) here so class names are unique?
hasher(`${base}:${css}:${local}`)
I'm trying to generate classnames similar to webpack's
localIdentName
where its default is a single hash: https://webpack.js.org/loaders/css-loader/#localidentnameWith a single
hash
token provided togenerateScopedName
, it looks like it's generated off of the file name and the entire contents of the css file, so every classname within the same document will receive the same hash:https://github.com/Anidetrix/rollup-plugin-styles/blob/5e877a862c9b349b8714dff8b61a8c8fbf64a775/src/loaders/postcss/modules/generate.ts#L15
Would it make sense to use something like
hasher(`${base}:${css}:${local}`)
here so class names are unique?