Anidetrix / rollup-plugin-styles

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
246 stars 43 forks source link

CSS Modules - generateScopedName does not work with globals #173

Open charleshimmer opened 3 years ago

charleshimmer commented 3 years ago

While using CSS Modules I think I found a bug. I was migrating from rollup-plugin-postcss where we exported globals AND controlled the scoped naming. I am finding while using this config does not allow you to export globals:

styles({
      autoModules: true,
      extract: false,
      modules: {
        exportGlobals: true,
        generateScopedName: `[name]__[local]___[hash:base64:5]___${getGitCommitHash()}`
      },
      minimize: true,
      use: ['sass']
    }),

If I remove the generateScopedName globals are exported again. Is there a way to control how scoped names are formatted AND export globals?

movahhedi commented 1 year ago

I have the same issue