Skip to content

cannot get postCSS autoprefixer to work #1237

@akhatri

Description

@akhatri
  • What is the current behavior?
    I am trying to implement PostCSS autoprefixer to my project but it doesn't seem to work. After going through the instructions on the PostCSS repo, I still have no luck so was hoping someone can assist. I have followed the steps as below
  1. postcss-loader installed through npm
  2. webpack.common.js snippet as below
    module: {
      rules: [
        /*
         * to string and css loader support for *.css files
         * Returns file content as string
         *
         */
        {
          test: /\.css$/,
          use: ['to-string-loader', 'css-loader', 'postcss-loader']
        },

        // support for .scss files
        // use 'null' loader in test mode (https://github.com/webpack/null-loader)
        // all css in src/style will be bundled in an external css file
        {
          test: /\.(scss|sass)$/,
          exclude: /node_modules/,
          loaders: ['raw-loader', 'postcss-loader', 'sass-loader']
        },
      ],
    }
  1. I have created a postcssconfig.js with the following plugins
module.exports = {
  plugins: [
    require('autoprefixer')({ /* ...options */ })
  ]
}

Is there some other setting or config that needs to be added? The vendor prefixes do not work e.g. display: flex in a sample scss file

  • Please tell us about your environment:
  • Angular version: 2.0.0
  • Browser: [Chrome]

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