Skip to content

Postcss-cssnext and precss breaking all plugins #138

Closed
@kilpatty

Description

@kilpatty

I'm currently experiencing this weird bug that seems to only occur with the Postcss-cssnext and precss plugins.

Forgot to mention my versions:
Webpack: 2.1.0-beta.25
Postcss-Loader: 1.1.1
Precss: 1.4.0
Postcss-cssnext: 2.8.0

Here is my current webpack config:

module.exports = {
...
module: {
    rules: [
      ...
      {
        test: /\.css$/,
        loaders: [
          'style-loader',
          {
            loader: 'css-loader',
            options: {
              importLoaders: 1,
              modules: true,
              localIdentName: '[path]___[name]__[local]___[hash:base64:5]',
            },
          },
          'postcss-loader',
        ],
      },
    ],
  },

Then my postcss.config.js:

module.exports = {
  plugins: [
    require('postcss-smart-import')({}),
    require('postcss-simple-vars')({}),
    // require('postcss-cssnext')({}),
    // required('precss)({}),
  ],
};

With both postcss-cssnext and precss commented out, this works perfectly fine. If I allow even one of these two plugins then all of my plugins stop working and I get errors from webpack: TypeError: [object Object] must be a function, did you require() it ?

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