@eik/postcss-import-map
Advanced tools
+7
-0
@@ -0,1 +1,8 @@ | ||
| ## [2.0.2](https://github.com/eik-lib/postcss-import-map/compare/v2.0.1...v2.0.2) (2020-11-19) | ||
| ### Bug Fixes | ||
| * document postcss-import usage ([8fe2451](https://github.com/eik-lib/postcss-import-map/commit/8fe24514aa7a32585d73e8b7aa6b2080d4ee35b8)) | ||
| ## [2.0.1](https://github.com/eik-lib/postcss-import-map/compare/v2.0.0...v2.0.1) (2020-11-19) | ||
@@ -2,0 +9,0 @@ |
+2
-2
| { | ||
| "name": "@eik/postcss-import-map", | ||
| "version": "2.0.1", | ||
| "version": "2.0.2", | ||
| "description": "PostCSS plugin that uses Eik defined import map files to transform bare import specifiers to absolute URLs in @import rules", | ||
@@ -50,3 +50,3 @@ "main": "dist/plugin.js", | ||
| "fastify": "3.8.0", | ||
| "postcss": "8.1.7", | ||
| "postcss": "8.1.8", | ||
| "rollup": "2.33.2", | ||
@@ -53,0 +53,0 @@ "semantic-release": "17.2.2", |
+36
-18
@@ -7,4 +7,4 @@ # postcss-import-map | ||
| - **This plugin should probably be used as the first plugin of your list. | ||
| Especially before the [postcss-import](https://github.com/postcss/postcss-import) plugin**. | ||
| - **This plugin should probably be used as the first plugin of your list.** | ||
| - **If you use `postcss-import` please [read this.](#postcss-import-usage)** | ||
@@ -30,18 +30,19 @@ ## Installation | ||
| postcss() | ||
| .use( | ||
| eikImportMapPlugin({ | ||
| imports: { | ||
| 'normalize.css': 'https://unpkg.com/normalize.css@8/normalize.css', | ||
| }, | ||
| .use( | ||
| eikImportMapPlugin({ | ||
| imports: { | ||
| 'normalize.css': | ||
| 'https://unpkg.com/normalize.css@8/normalize.css', | ||
| }, | ||
| }) | ||
| ) | ||
| .process(css, { | ||
| // `from` option is needed here | ||
| from: 'css/input.css', | ||
| }) | ||
| ) | ||
| .process(css, { | ||
| // `from` option is needed here | ||
| from: 'css/input.css', | ||
| }) | ||
| .then(function (result) { | ||
| var output = result.css; | ||
| .then(function (result) { | ||
| var output = result.css; | ||
| console.log(output); | ||
| }); | ||
| console.log(output); | ||
| }); | ||
| ``` | ||
@@ -55,3 +56,3 @@ | ||
| body { | ||
| background: black; | ||
| background: black; | ||
| } | ||
@@ -66,6 +67,23 @@ ``` | ||
| body { | ||
| background: black; | ||
| background: black; | ||
| } | ||
| ``` | ||
| ## PostCSS Import Usage | ||
| If you're using [postcss-import](https://github.com/postcss/postcss-import) make sure you update the `plugins` option. | ||
| `postcss.config.js` | ||
| ```js | ||
| module.exports = (ctx) => ({ | ||
| plugins: [ | ||
| require('@eik/postcss-import-map')(), | ||
| require('postcss-import')({ | ||
| // It needs to be added here as well to ensure everything is mapped | ||
| plugins: [require('@eik/postcss-import-map')], | ||
| }), | ||
| ], | ||
| }); | ||
| ``` | ||
| ## Options | ||
@@ -72,0 +90,0 @@ |
13185
6.33%120
17.65%