Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@eik/postcss-import-map

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eik/postcss-import-map - npm Package Compare versions

Comparing version
1.2.1
to
1.2.2
+7
-0
CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.2.2](https://github.com/eik-lib/postcss-import-map/compare/v1.2.1...v1.2.2) (2020-09-18)
### Bug Fixes
* try again to make the filter work ([9e89a10](https://github.com/eik-lib/postcss-import-map/commit/9e89a1002a2261615238b2f0433cbee8a1b9a2b7))
## [1.2.1](https://github.com/eik-lib/postcss-import-map/compare/v1.2.0...v1.2.1) (2020-09-18)

@@ -2,0 +9,0 @@

+9
-9

@@ -58,4 +58,8 @@ 'use strict';

// The resolve option in postcss-import doesn't support async functions or promises,
// thus we have to workaround it
const mapping = new Map();
// @TODO this could be a @eik/import-map-utils package
async function getImportMap({
async function populateImportMap({
path: eikPath = path__default['default'].join(process.cwd(), 'eik.json'),

@@ -65,3 +69,5 @@ urls = [],

} = {}) {
const mapping = new Map();
// Reset the map to avoid pollution
mapping.clear();
const importmapUrls = await readEikJSONMaps(eikPath);

@@ -87,10 +93,4 @@ for (const map of importmapUrls) {

});
return mapping;
}
// The resolve option in postcss-import doesn't support async functions or promises,
// thus we have to workaround it
let mapping = new Map();
var plugin = postcss__default['default'].plugin(

@@ -101,3 +101,3 @@ '@eik/postcss-import-map',

return async (root) => {
mapping = await getImportMap({ path, urls, imports });
await populateImportMap({ path, urls, imports });
root.walkAtRules('import', (decl) => {

@@ -104,0 +104,0 @@ let key;

{
"name": "@eik/postcss-import-map",
"version": "1.2.1",
"version": "1.2.2",
"description": "PostCSS plugin that uses Eik defined import map files to transform bare import specifiers to absolute URLs in @import rules",

@@ -5,0 +5,0 @@ "main": "dist/plugin.js",

@@ -46,4 +46,8 @@ /* eslint-disable no-restricted-syntax, no-shadow */

// The resolve option in postcss-import doesn't support async functions or promises,
// thus we have to workaround it
const mapping = new Map();
// @TODO this could be a @eik/import-map-utils package
async function getImportMap({
async function populateImportMap({
path: eikPath = path.join(process.cwd(), 'eik.json'),

@@ -53,3 +57,5 @@ urls = [],

} = {}) {
const mapping = new Map();
// Reset the map to avoid pollution
mapping.clear();
const importmapUrls = await readEikJSONMaps(eikPath);

@@ -75,10 +81,4 @@ for (const map of importmapUrls) {

});
return mapping;
}
// The resolve option in postcss-import doesn't support async functions or promises,
// thus we have to workaround it
let mapping = new Map();
export default postcss.plugin(

@@ -89,3 +89,3 @@ '@eik/postcss-import-map',

return async (root) => {
mapping = await getImportMap({ path, urls, imports });
await populateImportMap({ path, urls, imports });
root.walkAtRules('import', (decl) => {

@@ -92,0 +92,0 @@ let key;