Skip to content
This repository was archived by the owner on May 29, 2022. It is now read-only.

Support for autoprefixer? #28

@mikeesouth

Description

@mikeesouth

Hey,

Webpack 2 seems to have removed the postcss section and adding autoprefixer seems difficult. I tried adding it like this to my webpack.config.ts file (fetched from the aurelia skeleton-typescript-webpack):

....
var loaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
var autoprefixer = require('autoprefixer');
....
plugins: [
      new loaderOptionsPlugin({
        options: {
          postcss: [
            autoprefixer()
          ]
        }
      })
    ],
...
  html(),
  css({ filename: 'styles.css', allChunks: true, sourceMap: false,
        additionalLoaders: ['postcss'] }),
  sass({ filename: 'styles.css', allChunks: true, sourceMap: false,
         additionalLoaders: ['postcss'] }),
  json(),
  fontAndImages(),
  globalBluebird(),
...

First I imported loaderOptionsPlugin and autoprefixer, then I loaded autoprefixer as a postcss option to loaderOptionsPlugin and finally I added additionaloaders (postcss) to my css and sass @easy-webpack modules.

This did not work. Any ideas?
Or maybe some kind soul would like to write @easy-webpack/config-autoprefixer? :)

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