Skip to content

New PR that meets the convention. #145

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

Merged
merged 3 commits into from
Dec 3, 2016
Merged

New PR that meets the convention. #145

merged 3 commits into from
Dec 3, 2016

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented Dec 3, 2016

In the previous code, PRed code didn't meet the convention. So, I fixed it here.

For the readers who googled this document.

We discussed about the configuration path for the postcss-loader at #143. If you want to know how it works, read that document.

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Dec 3, 2016

@sainthkh did you test it with webpack >= v2.x ?

{
  test: /\.css/,
  use: [ 
    { loader: 'css-loader', options: { importLoaders: 1 } }, 
    { loader: 'postcss-loader', options: { config: 'alternative/path/to/postcss.config.js' } }
  ]
}

Normally should be working just fine as it is implemented atm

@sainthkh
Copy link
Contributor Author

sainthkh commented Dec 3, 2016

@michael-ciniawsky I've checked it out and there was no problem.

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Dec 3, 2016

@sainthkh This has popped in my mind recently, but I can also add it later :)

webpack.config.js

{
  test: /\.css/,
  use: [ 
    { loader: 'css-loader', options: { importLoaders: 1 } }, 
    { 
       loader: 'postcss-loader', 
       options: { 
         config: { file: 'alternative/path/to/postcss.config.js', ctx: { modules: true } } 
       }
    }
  ]
}

postcss.config.js

module.exports = (ctx) => {
   return {
    parser: 'sugarss',
    plugins: {
      'postcss-import': {},
      'postcss-modules': ctx.modules ? {} : false
    }
  }
}

@ai Please confirm PR

@ai
Copy link
Contributor

ai commented Dec 3, 2016

I will confirm and release today at evening

@ai ai merged commit 1e8203c into webpack-contrib:master Dec 3, 2016
@ai
Copy link
Contributor

ai commented Dec 3, 2016

Published in 1.2. Thanks for your work =^_^=.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants