Skip to content

Remove underscore and integer from CSS Module localIdentName with single file components. #818

Closed
@DaemonCahill

Description

@DaemonCahill

What problem does this feature solve?

I'm loving CSS Modules with Vue.js but am having an issue dealing with a static export for server side rendering. I've been using the following for my localIdentName in webpack config:

cssModules: { localIdentName: '[name]-[local]' },

However, all of my classnames are generating with an _0 at the end which appears to be the direct result of using CSS modules in single file components. If the style tag uses an external source then the integer will go away, and if there are multiple styles the integer will be incremented accordingly.

Ideally, there would be a workaround where I could use single file components with inline modules without having the _integer generated by default.

What does the proposed API look like?

Unclear. Presumably this would be a minor setting or customization in the webpack configuration for vue loader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions