Skip to content

v2.0.0 - #191

Merged
michael-ciniawsky merged 2 commits into
webpack:masterfrom
michael-ciniawsky:v2
May 8, 2017
Merged

v2.0.0#191
michael-ciniawsky merged 2 commits into
webpack:masterfrom
michael-ciniawsky:v2

Conversation

@michael-ciniawsky

@michael-ciniawsky michael-ciniawsky commented Mar 28, 2017 •

Copy link
Copy Markdown
Contributor

Refactor

options.config

webpack.config.js

{
  test: /\.scss$/
  use: [ 
    { 
      loader: 'postcss-loader',
      options: { config: { path: 'path/to/postcss.config.js', ctx: {} }
    }
  ]
}

postcss.config.js

module.exports = ({ file, options /* options.ctx */, env}) => ({
   parser: file.extname  === '.sss' ? 'sugarss' : false,
   plugins: {
      'postcss-nested':  {},
      'cssnano': env === 'production' ? { safe: true } : false
   } 
})

Features

Syntax Error

Syntax Error

Options Validation Error

Validation Error

Module Export

This is especially useful for Angular 2 Users

webpack.config.js

{
  test: /\.scss$/
- use: [ 'raw-loader',  'sass-loader' ]
+ use: [ 'postcss-loader', 'sass-loader' ]
}

Breaking Changes

options.config

Removed Loader API (ctx.webpack)

options.pack

Removed Completely

options.rewrite (webpack Plugin Hook)

Removed Completely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants