Skip to content

Should it works with dash symbol in name? #27

Closed
@SanichKotikov

Description

@SanichKotikov

Hi,

For example, I have next code:

/* values.css */
@value test-t: 40px;
@value test_q: 36px;
@value test-t, test_q from "values.css";

.root {
  height: test-t;
  height: test_q;
}

Result I've got:

.Comp__root__wrlsR {
  height: undefined;
  height: 36px;
}

Webpack rule I use:

{
    test: /\.css$/,
    exclude: /node_modules/,
    sideEffects: true,
    use: [
        isProd ? MiniCssExtractPlugin.loader : 'style-loader',
        {
            loader: 'css-loader',
            options: {
                importLoaders: 1,
                modules: {
                    mode: 'local',
                    exportLocalsConvention: 'dashesOnly',
                    localIdentName: isProd ? '[hash:base64:5]' : '[name]__[local]__[hash:base64:5]',
                },
            },
        },
        {
            loader: 'postcss-loader',
            options: {
                postcssOptions: {
                    plugins: {
                        'postcss-nesting': {},
                        'postcss-modules-values': {},
                        ...(isProd && { autoprefixer: { flexbox: 'no-2009' } }),
                    },
                },
            },
        },
    ],
},

Is there something I've missed?

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