Skip to content

css-modulesify does not play well with cssnext #44

@ryngonzalez

Description

@ryngonzalez

I've tried with a bunch of configurations, and none seem to be working:

1. In --use declaration

  .plugin('css-modulesify', {
    rootDir: __dirname,
    output: `${dirs.dest.styles}/compiled.css`,
    use: [
      "postcss-modules-extract-imports",
      "postcss-modules-local-by-default",
      "postcss-modules-scope",
      'autoprefixer',
      'cssnext'
    ],
    'postcss-modules-scope': {
      generateScopedName: createClassName
    },
    after: [
    ]
  })

2. In --after declaration

  .plugin('css-modulesify', {
    rootDir: __dirname,
    output: `${dirs.dest.styles}/compiled.css`,
    use: [
      "postcss-modules-extract-imports",
      "postcss-modules-local-by-default",
      "postcss-modules-scope",
      'autoprefixer'
    ],
    'postcss-modules-scope': {
      generateScopedName: createClassName
    },
    after: [
      'cssnext'
    ]
  })

3. Required and used in --use declaration

  .plugin('css-modulesify', {
    rootDir: __dirname,
    output: `${dirs.dest.styles}/compiled.css`,
    use: [
      "postcss-modules-extract-imports",
      "postcss-modules-local-by-default",
      "postcss-modules-scope",
      'autoprefixer',
      require('cssnext')
    ],
    'postcss-modules-scope': {
      generateScopedName: createClassName
    },
    after: [
    ]
  })

4. Required and used in --after declaration

  .plugin('css-modulesify', {
    rootDir: __dirname,
    output: `${dirs.dest.styles}/compiled.css`,
    use: [
      "postcss-modules-extract-imports",
      "postcss-modules-local-by-default",
      "postcss-modules-scope",
      'autoprefixer'
    ],
    'postcss-modules-scope': {
      generateScopedName: createClassName
    },
    after: [
      require('cssnext')
    ]
  })

5. Required and used in --use declaration, initialized with options

  .plugin('css-modulesify', {
    rootDir: __dirname,
    output: `${dirs.dest.styles}/compiled.css`,
    use: [
      "postcss-modules-extract-imports",
      "postcss-modules-local-by-default",
      "postcss-modules-scope",
      'autoprefixer',
      require('cssnext')({})
    ],
    'postcss-modules-scope': {
      generateScopedName: createClassName
    },
    after: [
    ]
  })

6. Required and used in --after declaration, initialized with options

  .plugin('css-modulesify', {
    rootDir: __dirname,
    output: `${dirs.dest.styles}/compiled.css`,
    use: [
      "postcss-modules-extract-imports",
      "postcss-modules-local-by-default",
      "postcss-modules-scope",
      'autoprefixer'
    ],
    'postcss-modules-scope': {
      generateScopedName: createClassName
    },
    after: [
      require('cssnext')({})
    ]
  })

Am I just missing fundamental, or is there some for of issue with how we're adding additional PostCSS plugins to the css-modulesify pipeline?

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