Skip to content

how to apply a specific postcss plugin to only a specific set of files #985

@tomwayson

Description

@tomwayson

we have a need to apply the autoprefixer plugin to all css output files, but then apply the rtlcss postcss plugin to only our app-rtl.css file. Is there a way to configure ember-cli-postcss to do that? It seems like the filter will apply all plugins to all files.

we're coming to this plugin from ember-cli-css-preprocess and you passed that an array of processor configurations, each being roughly equivalent to this addon's filter, so we were able to achieve this by passing multple processors like:

        {
          type: 'postcss',
          // only run this for the -rtl file...
          filter: ['app-rtl.scss'],
          plugins: [
            {
              module: require('rtlcss'),
              options: {}
            }
          ]
        },
        {
          type: 'postcss',
          plugins: [
            {
              module: require('autoprefixer'),
            }
          ]
        }

With this addon it looks like you can only configure one filter and all the plugins you define in that filter are applied to all the files it matches.

Is there some way to conditionally apply a plugin to a specific set of files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions