Skip to content

Custom localIdent name as a function #292

Closed
@longlho

Description

@longlho

Right now localIdentName allows me to put in a certain pattern [name]_[hash] for PostCSS I have a custom generateScopedName function that basically spit out a custom shorter name based on all my classes (kinda like module ids). Something similar to:

function generateScopedName (...args) {
    const longName = exports.generateLongName(...args)
    if (WEBPACK_CSS_NAME_MAP[longName] === undefined) {
        WEBPACK_CSS_NAME_MAP[longName] = `${PREFIX}${Object.keys(WEBPACK_CSS_NAME_MAP).length}`
    }

    return WEBPACK_CSS_NAME_MAP[longName]
}

However, with this plugin I can't pass generateScopedName as a function like PostCSS. Any suggestions?

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