Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webpack-blocks/postcss

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webpack-blocks/postcss - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

4

CHANGELOG.md
# @webpack-blocks/postcss - Changelog
## 0.3.2
- Bug fix: PostCSS plugin configuration now works with webpack 2 ([#68](https://github.com/andywer/webpack-blocks/issues/68))
## 0.3.1

@@ -4,0 +8,0 @@

41

index.js

@@ -30,15 +30,34 @@ /**

return (context) => Object.assign({
module: {
loaders: [
{
test: context.fileType('text/css'),
exclude: Array.isArray(exclude) ? exclude : [ exclude ],
loaders: [ 'style-loader', 'css-loader', 'postcss-loader?' + JSON.stringify(postcssOptions) ]
}
return (context) => Object.assign(
{
module: {
loaders: [
{
test: context.fileType('text/css'),
exclude: Array.isArray(exclude) ? exclude : [ exclude ],
loaders: [ 'style-loader', 'css-loader', 'postcss-loader?' + JSON.stringify(postcssOptions) ]
}
]
}
},
plugins ? createPostcssPluginsConfig(context.webpack, plugins) : {}
)
}
function createPostcssPluginsConfig (webpack, plugins) {
const isWebpack2 = typeof webpack.validateSchema !== 'undefined'
if (isWebpack2) {
return {
plugins: [
new webpack.LoaderOptionsPlugin({
options: { postcss: plugins }
})
]
}
}, plugins ? {
postcss: plugins
} : {})
} else {
return {
postcss: plugins
}
}
}
{
"name": "@webpack-blocks/postcss",
"version": "0.3.1",
"version": "0.3.2",
"description": "Webpack block for PostCSS.",

@@ -5,0 +5,0 @@ "main": "lib/index",

@@ -23,3 +23,14 @@ # Webpack blocks - PostCSS

Instead of passing the PostCSS plugins as an array you can also create a `postcss.config.js` file containing the plugin configuration (see [PostCSS loader usage](https://github.com/postcss/postcss-loader#usage)):
```js
// postcss.config.js
module.exports = {
plugins: [
require('precss')
]
}
```
## Options

@@ -26,0 +37,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc