@eik/postcss-import-map
Advanced tools
+7
-0
@@ -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; |
+1
-1
| { | ||
| "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", |
+9
-9
@@ -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; |
15232
1.87%