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.0 to 0.3.1

4

CHANGELOG.md
# @webpack-blocks/postcss - Changelog
## 0.3.1
- Supporting custom PostCSS options now (`parser`, `stringifier`, `syntax`)
## 0.3.0

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

@@ -10,5 +10,8 @@ /**

/**
* @param {PostCSSPlugin[]} [plugins] Will read `postcss.config.js` file if not supplied.
* @param {PostCSSPlugin[]} [plugins] Will read `postcss.config.js` file if not supplied.
* @param {object} [options]
* @param {RegExp, Function, string} [options.exclude] Directories to exclude.
* @param {RegExp|Function|string} [options.exclude] Directories to exclude.
* @param {string} [options.parser] Package name of custom PostCSS parser to use.
* @param {string} [options.stringifier] Package name of custom PostCSS stringifier to use.
* @param {string} [options.syntax] Package name of custom PostCSS parser/stringifier to use.
* @return {Function}

@@ -20,2 +23,10 @@ */

// https://github.com/postcss/postcss-loader#options
const postcssOptions = Object.assign(
{},
options.parser && { parser: options.parser },
options.stringifier && { stringifier: options.stringifier },
options.syntax && { syntax: options.syntax }
)
return (context) => Object.assign({

@@ -27,3 +38,3 @@ module: {

exclude: Array.isArray(exclude) ? exclude : [ exclude ],
loaders: [ 'style-loader', 'css-loader', 'postcss-loader' ]
loaders: [ 'style-loader', 'css-loader', 'postcss-loader?' + JSON.stringify(postcssOptions) ]
}

@@ -30,0 +41,0 @@ ]

2

package.json
{
"name": "@webpack-blocks/postcss",
"version": "0.3.0",
"version": "0.3.1",
"description": "Webpack block for PostCSS.",

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

@@ -19,3 +19,3 @@ # Webpack blocks - PostCSS

autoprefixer({ browsers: ['last 2 versions'] })
])
], { /* custom PostCSS options */ })
])

@@ -25,2 +25,14 @@ ```

## Options
#### parser *(optional)*
Package name of a custom PostCSS parser to use. Pass for instance `'sugarss'` to be able to write indent-based CSS.
#### stringifier *(optional)*
Package name of a custom PostCSS stringifier to use.
#### syntax *(optional)*
Package name of a custom PostCSS syntax to use. The package must export a `parse` and a `stringify` function.
## Webpack blocks

@@ -27,0 +39,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