Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

Not working in config with plugins object #23

@aaronjpitts

Description

@aaronjpitts

This is my postcss.config.js which is used with webpack.

const glob = require('glob-all');
const cssnanoConfig = {
  preset: ['default', { discardComments: { removeAll: true } }]
};

module.exports = ({ file, options }) => {
  return {
    parser: options.enabled.optimize ? 'postcss-safe-parser' : undefined,
    plugins: {
      autoprefixer: true,
      purgecss: {
         content: glob.sync([
          'app/**/*.php',
          'resources/views/**/*.php',
          'resources/assets/scripts/**/*.js',
        ]),
        whitelistPatterns: [/^slick/],
      },
      cssnano: options.enabled.optimize ? cssnanoConfig : false,
    },
  };
};

But upon building I get this error:
Module build failed: ModuleBuildError: Module build failed: Error: Loading PostCSS Plugin failed: Cannot call a class as a function

Do you know what the problem is?

Many thanks

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