Skip to content

postcss-easy-import troubles #371

Closed
Closed
@Windvis

Description

@Windvis

Hey!

After updating to Ember cli 3.7 (coming from 3.4 LTS) our postcss build pipeline stopped working properly. I already created an issue on the postcss-easy-import repo to get some insights.

After talking with Sam Selikoff in the ember discord I think it might be related to ember-cli-postcss. Sam uses the same combination of postcss plugins for the ember-cli-tailwind addon, and that addon has no problems running in ember cli 3.5+.

Short version, postcss-easy-import can't find files in the node_modules folder. postcss-import, the library that postcss-easy-import uses internally does find them, but I'm not sure what they do differently.

Our config:

{
//...
    postcssOptions: {
      compile: {
        plugins: [
          { module: postCssEasyImport },
          {
            module: postCssNested,
            options: {
              bubble: ['screen'],
            }
          },
          tailwindcss('./tailwind.js'),
          {
            module: purgecss,
            options: {
              content: ['./app/templates/**/*.hbs', './app/components/**/*.js', './app/controllers/**/*.js'],
              extractors: [
                {
                  // Custom extractor to allow special characters (like ":") in class names
                  // See: https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css-with-purgecss
                  extractor: TailwindExtractor,
                  extensions: ['hbs', 'js'],
                }
              ]
            }
          },
          { module: postcssSystemUiFont },
        ],
      },
      filter: {
        enabled: true,
        plugins: [
          { module: autoprefixer }, // We add autoprefixer here to make it also handle vendor styles
        ],
      },
    },
}

example css:

@import "tailwindcss/preflight"; /* node_modules imports don't work */
@import "components/**/*.css"; /* local imports do work */

Any idea what the problem could be? We can just use postcss-import so it's not a high priority, but I really want to find out what's causing this :D.

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