postcss-loader
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [4.2.0](https://github.com/webpack-contrib/postcss-loader/compare/v4.1.0...v4.2.0) (2021-01-21) | ||
### Features | ||
* added the `implementation` option ([#511](https://github.com/webpack-contrib/postcss-loader/issues/511)) ([deac978](https://github.com/webpack-contrib/postcss-loader/commit/deac9787eed614b1c445f091a2b70736a6212812)) | ||
## [4.1.0](https://github.com/webpack-contrib/postcss-loader/compare/v4.0.4...v4.1.0) (2020-11-19) | ||
@@ -7,0 +14,0 @@ |
@@ -49,2 +49,3 @@ "use strict"; | ||
const configOption = typeof options.postcssOptions === "undefined" || typeof options.postcssOptions.config === "undefined" ? true : options.postcssOptions.config; | ||
const postcssFactory = options.implementation || _postcss.default; | ||
let loadedConfig; | ||
@@ -95,3 +96,3 @@ | ||
try { | ||
result = await (0, _postcss.default)(plugins).process(root || content, processOptions); | ||
result = await postcssFactory(plugins).process(root || content, processOptions); | ||
} catch (error) { | ||
@@ -98,0 +99,0 @@ if (error.file) { |
@@ -38,2 +38,6 @@ { | ||
"type": "boolean" | ||
}, | ||
"implementation": { | ||
"description": "The implementation of postcss to use, instead of the locally installed version (https://github.com/postcss/postcss-loader#implementation)", | ||
"instanceof": "Function" | ||
} | ||
@@ -40,0 +44,0 @@ }, |
{ | ||
"name": "postcss-loader", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "PostCSS loader for webpack", | ||
@@ -49,8 +49,8 @@ "license": "MIT", | ||
"schema-utils": "^3.0.0", | ||
"semver": "^7.3.2" | ||
"semver": "^7.3.4" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.12.1", | ||
"@babel/core": "^7.12.3", | ||
"@babel/preset-env": "^7.12.1", | ||
"@babel/cli": "^7.12.10", | ||
"@babel/core": "^7.12.10", | ||
"@babel/preset-env": "^7.12.11", | ||
"@commitlint/cli": "^11.0.0", | ||
@@ -61,30 +61,30 @@ "@commitlint/config-conventional": "^11.0.0", | ||
"babel-jest": "^26.6.3", | ||
"cross-env": "^7.0.2", | ||
"cross-env": "^7.0.3", | ||
"cssnano": "^4.1.10", | ||
"del": "^6.0.0", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.13.0", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint": "^7.18.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"husky": "^4.3.0", | ||
"husky": "^4.3.8", | ||
"jest": "^26.6.3", | ||
"less": "^3.12.2", | ||
"less-loader": "^7.1.0", | ||
"lint-staged": "^10.5.1", | ||
"less": "^4.1.0", | ||
"less-loader": "^7.2.1", | ||
"lint-staged": "^10.5.3", | ||
"memfs": "^3.2.0", | ||
"midas": "^2.0.3", | ||
"npm-run-all": "^4.1.5", | ||
"postcss": "^8.1.7", | ||
"postcss": "^8.2.4", | ||
"postcss-dark-theme-class": "^0.5.1", | ||
"postcss-import": "^13.0.0", | ||
"postcss-import": "^14.0.0", | ||
"postcss-js": "^3.0.3", | ||
"postcss-nested": "^5.0.1", | ||
"postcss-nested": "^5.0.3", | ||
"postcss-short": "^5.0.0", | ||
"prettier": "^2.1.2", | ||
"sass": "^1.29.0", | ||
"sass-loader": "^10.1.0", | ||
"standard-version": "^9.0.0", | ||
"prettier": "^2.2.0", | ||
"sass": "^1.32.5", | ||
"sass-loader": "^10.1.1", | ||
"standard-version": "^9.1.0", | ||
"strip-ansi": "^6.0.0", | ||
"sugarss": "^3.0.3", | ||
"webpack": "^5.6.0" | ||
"webpack": "^5.16.0" | ||
}, | ||
@@ -91,0 +91,0 @@ "keywords": [ |
@@ -132,3 +132,3 @@ <div align="center"> | ||
| [`execute`](#execute) | `{Boolean}` | `undefined` | Enable PostCSS Parser support in `CSS-in-JS` | | ||
| [`postcssOptions`](#postcssOptions) | `{Object\/Function}` | `defaults values for Postcss.process` | Set `PostCSS` options and plugins | | ||
| [`postcssOptions`](#postcssOptions) | `{Object\|Function}` | `defaults values for Postcss.process` | Set `PostCSS` options and plugins | | ||
| [`sourceMap`](#sourcemap) | `{Boolean}` | `compiler.devtool` | Enables/Disables generation of source maps | | ||
@@ -177,3 +177,3 @@ | ||
Allows to set [`PostCSS options`](http://api.postcss.org/global.html#processOptions) and plugins. | ||
Allows to set [`PostCSS options`](https://postcss.org/api/#processoptions) and plugins. | ||
@@ -375,3 +375,3 @@ All `PostCSS` options are supported. | ||
- a `.postcssrc` file in JSON or YAML format | ||
- a `.postcss.json`, `.postcss.yaml`, `.postcss.yml`, `.postcss.js`, or `.postcss.cjs` file | ||
- a `.postcssrc.json`, `.postcssrc.yaml`, `.postcssrc.yml`, `.postcssrc.js`, or `.postcssrc.cjs` file | ||
- a `postcss.config.js` or `postcss.config.cjs` CommonJS module exporting an object (**recommended**) | ||
@@ -387,3 +387,3 @@ | ||
module.exports = { | ||
// You can specify any options from http://api.postcss.org/global.html#processOptions here | ||
// You can specify any options from https://postcss.org/api/#processoptions here | ||
// parser: 'sugarss', | ||
@@ -412,3 +412,3 @@ plugins: [ | ||
return { | ||
// You can specify any options from http://api.postcss.org/global.html#processOptions here | ||
// You can specify any options from https://postcss.org/api/#processoptions here | ||
parser: "sugarss", | ||
@@ -424,3 +424,3 @@ plugins: [ | ||
return { | ||
// You can specify any options from http://api.postcss.org/global.html#processOptions here | ||
// You can specify any options from https://postcss.org/api/#processoptions here | ||
plugins: [ | ||
@@ -439,3 +439,3 @@ // Plugins for PostCSS | ||
module.exports = { | ||
// You can specify any options from http://api.postcss.org/global.html#processOptions here | ||
// You can specify any options from https://postcss.org/api/#processoptions here | ||
// parser: 'sugarss', | ||
@@ -603,2 +603,33 @@ plugins: { | ||
### `implementation` | ||
Type: `Function` | ||
The special `implementation` option determines which implementation of PostCSS to use. Overrides the locally installed `peerDependency` version of `postcss`. | ||
**This option is only really useful for downstream tooling authors to ease the PostCSS 7-to-8 transition.** | ||
**webpack.config.js** | ||
```js | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/i, | ||
use: [ | ||
{ loader: "style-loader" }, | ||
{ loader: "css-loader" }, | ||
{ | ||
loader: "postcss-loader", | ||
options: { implementation: require("postcss") }, | ||
}, | ||
{ loader: "sass-loader" }, | ||
], | ||
}, | ||
], | ||
}, | ||
}; | ||
``` | ||
## Examples | ||
@@ -605,0 +636,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58871
488
1069
+ Addedcaniuse-lite@1.0.30001679(transitive)
+ Addedelectron-to-chromium@1.5.55(transitive)
+ Addedpostcss@8.4.47(transitive)
- Removedcaniuse-lite@1.0.30001680(transitive)
- Removedelectron-to-chromium@1.5.57(transitive)
- Removedpostcss@8.4.49(transitive)
Updatedsemver@^7.3.4