Skip to content

[QUESTION] Support for .cjs extension of postcss config file? #28

@danawoodman

Description

@danawoodman

Is it possible to specify a different extension for the PostCSS config file, e.g. postcss.config.cjs? Is this a configuration option available?

I'm using SvelteKit which requires the .cjs extensions since it is using ESM as the default import for .js files. I'm assuming perhaps the issue I'm facing has to do with the .cjs extension.

The exact issue is I'm using postcss-nesting to have nested styles but the following fails:

ModuleBuildError: Module build failed (from ./node_modules/svelte-loader/index.js):
Error: ParseError: Identifier is expected (24:5)
22: <style lang="postcss">
23:   section {
24:     & dl {
         ^
25:       @apply mr-6 border-r pr-6 border-gray-300 text-center;

It seems to be choking on the nesting syntax which I assume is either from my PostCSS config not being imported or perhaps the PostCSS addon is not being picked up in the Svelte template

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions