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

postcss-loader

Package Overview
Dependencies
Maintainers
3
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-loader - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [5.2.0](https://github.com/webpack-contrib/postcss-loader/compare/v5.1.0...v5.2.0) (2021-03-11)
### Features
* support `ecma` modules for the 'parser', 'stringifier' and 'syntax' options ([#519](https://github.com/webpack-contrib/postcss-loader/issues/519)) ([cc69754](https://github.com/webpack-contrib/postcss-loader/commit/cc69754383f6f9881ac5f02ec489eb89db2cfb0d))
## [5.1.0](https://github.com/webpack-contrib/postcss-loader/compare/v5.0.0...v5.1.0) (2021-03-05)

@@ -7,0 +14,0 @@

2

dist/index.js

@@ -57,3 +57,3 @@ "use strict";

processOptions
} = (0, _utils.getPostcssOptions)(this, loadedConfig, options.postcssOptions);
} = await (0, _utils.getPostcssOptions)(this, loadedConfig, options.postcssOptions);

@@ -60,0 +60,0 @@ if (useSourceMap) {

@@ -168,3 +168,29 @@ "use strict";

function getPostcssOptions(loaderContext, loadedConfig = {}, postcssOptions = {}) {
async function load(module) {
let exports;
try {
// eslint-disable-next-line import/no-dynamic-require, global-require
exports = require(module);
return exports;
} catch (requireError) {
let importESM;
try {
// eslint-disable-next-line no-new-func
importESM = new Function("id", "return import(id);");
} catch (e) {
importESM = null;
}
if (requireError.code === "ERR_REQUIRE_ESM" && importESM) {
exports = await importESM(module);
return exports.default;
}
throw requireError;
}
}
async function getPostcssOptions(loaderContext, loadedConfig = {}, postcssOptions = {}) {
const file = loaderContext.resourcePath;

@@ -235,4 +261,3 @@ let normalizedPostcssOptions = postcssOptions;

try {
// eslint-disable-next-line import/no-dynamic-require, global-require
processOptions.parser = require(processOptions.parser);
processOptions.parser = await load(processOptions.parser);
} catch (error) {

@@ -245,4 +270,3 @@ loaderContext.emitError(new Error(`Loading PostCSS "${processOptions.parser}" parser failed: ${error.message}\n\n(@${file})`));

try {
// eslint-disable-next-line import/no-dynamic-require, global-require
processOptions.stringifier = require(processOptions.stringifier);
processOptions.stringifier = await load(processOptions.stringifier);
} catch (error) {

@@ -255,4 +279,3 @@ loaderContext.emitError(new Error(`Loading PostCSS "${processOptions.stringifier}" stringifier failed: ${error.message}\n\n(@${file})`));

try {
// eslint-disable-next-line import/no-dynamic-require, global-require
processOptions.syntax = require(processOptions.syntax);
processOptions.syntax = await load(processOptions.syntax);
} catch (error) {

@@ -259,0 +282,0 @@ loaderContext.emitError(new Error(`Loading PostCSS "${processOptions.syntax}" syntax failed: ${error.message}\n\n(@${file})`));

{
"name": "postcss-loader",
"version": "5.1.0",
"version": "5.2.0",
"description": "PostCSS loader for webpack",

@@ -5,0 +5,0 @@ "license": "MIT",

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