Skip to content

How to extract css file whose name is not hash #157

Answered by wilkinsonjack1993
iWun asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @iWun,

I just ran into this problem. You need to set the assetFileNames property in the rollup config output:

import styles from "rollup-plugin-styles";

export default {
  output: {
    assetFileNames: "[name][extname]",
  },
  plugins: [styles()],
};

By default, I think it is "[name]-[hash][extname]", which is why you get the hash at the end of the filename. N.B. This will increase the chances of name clash in your file output.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Anidetrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #157 on December 28, 2020 01:06.