Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with scss modules including inline comments #436

Open
mir3z opened this issue Dec 8, 2022 · 0 comments
Open

Not working with scss modules including inline comments #436

mir3z opened this issue Dec 8, 2022 · 0 comments

Comments

@mir3z
Copy link

mir3z commented Dec 8, 2022

module.exports = [
    {
        input: "components/Button",
        output: {
            file: "dist/components/Button.js",
            format: "es"
        },
        plugins: [
            peerDepsExternal(),
            postcss({
                extract: false,
                modules: true,
                autoModules: true,
                use: ["sass"],
                parser: "postcss-scss",
            }),
            babel({ babelHelpers: "runtime", exclude: "node_modules/**" }),
            resolve({ extensions: [".js", ".jsx", ".scss"] }),
            commonjs(),
        ],
        external: [/@babel\/runtime/]
    }
];

This throws an error

CssSyntaxError: <my-file>.module.scss:3:1: Unexpected '/'. Escaping special characters with \ may help.

caused by postcss-modules-local-by-default.

The error suggests the problem is inline comment which I have in line 3, and indeed - if I remove it starts working, however I don't see it as a fix. Inline comment is valid scss syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant