Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.0 #191

Merged
merged 2 commits into from
May 8, 2017
Merged

v2.0.0 #191

merged 2 commits into from
May 8, 2017

Conversation

michael-ciniawsky
Copy link
Member

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

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