Skip to content

Commit

Permalink
feat: Rename module to @eik/postcss-plugin (#83)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Rename module to @eik/postcss-plugin

Co-authored-by: Trygve Lie <trygve.lie@finn.no>
  • Loading branch information
trygve-lie and Trygve Lie committed Feb 18, 2021
1 parent 77f5c62 commit 7efa758
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PostCSS [Eik](https://eik.dev/) plugin to support the use of import maps to map
## Installation

```bash
$ npm install @eik/postcss-import-map
$ npm install @eik/postcss-plugin
```

## Usage
Expand All @@ -19,15 +19,15 @@ $ npm install @eik/postcss-import-map
// dependencies
var fs = require('fs');
var postcss = require('postcss');
var eikImportMapPlugin = require('@eik/postcss-import-map');
var plugin = require('@eik/postcss-plugin');

// css to be processed
var css = fs.readFileSync('css/input.css', 'utf8');

// process css
postcss()
.use(
eikImportMapPlugin({
plugin({
imports: {
'normalize.css':
'https://unpkg.com/normalize.css@8/normalize.css',
Expand Down Expand Up @@ -73,10 +73,10 @@ If you're using [postcss-import](https://github.com/postcss/postcss-import) make
```js
module.exports = (ctx) => ({
plugins: [
require('@eik/postcss-import-map')(),
require('@eik/postcss-plugin')(),
require('postcss-import')({
// It needs to be added here as well to ensure everything is mapped
plugins: [require('@eik/postcss-import-map')],
plugins: [require('@eik/postcss-plugin')],
}),
],
});
Expand All @@ -92,11 +92,11 @@ The path to the location of an `eik.json` file can be specified with the `path`
```js
module.exports = (ctx) => ({
plugins: [
require('@eik/postcss-import-map')({ path: '/path/to/eik.json' }),
require('@eik/postcss-plugin')({ path: '/path/to/eik.json' }),
require('postcss-import')({
// It needs to be added here as well to ensure everything is mapped
plugins: [
require('@eik/postcss-import-map')({
require('@eik/postcss-plugin')({
path: '/path/to/eik.json',
}),
],
Expand All @@ -111,13 +111,13 @@ The path to the location of a `package.json` file can be specified with the `pac
```js
module.exports = (ctx) => ({
plugins: [
require('@eik/postcss-import-map')({
require('@eik/postcss-plugin')({
packagePath: '/path/to/package.json',
}),
require('postcss-import')({
// It needs to be added here as well to ensure everything is mapped
plugins: [
require('@eik/postcss-import-map')({
require('@eik/postcss-plugin')({
packagePath: '/path/to/package.json',
}),
],
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@eik/postcss-import-map",
"name": "@eik/postcss-plugin",
"version": "2.0.4",
"description": "PostCSS plugin that uses Eik defined import map files to transform bare import specifiers to absolute URLs in @import rules",
"main": "dist/plugin.js",
"files": [
"dist",
"CHANGELOG.md"
"CHANGELOG.md",
"package.json",
"dist"
],
"directories": {
"dist": "dist"
Expand Down Expand Up @@ -45,16 +46,16 @@
"eslint": "7.20.0",
"eslint-config-airbnb-base": "14.2.1",
"eslint-plugin-import": "2.22.1",
"eslint-config-prettier": "^7.0.0",
"eslint-config-prettier": "7.0.0",
"fastify": "3.12.0",
"postcss": "8.2.6",
"rollup": "2.39.0",
"semantic-release": "17.3.9",
"tap": "14.11.0"
},
"dependencies": {
"css-url-parser": "^1.1.3",
"node-fetch": "^2.6.1"
"css-url-parser": "1.1.3",
"node-fetch": "2.6.1"
},
"peerDependencies": {
"postcss": "^8.0.0"
Expand Down

0 comments on commit 7efa758

Please sign in to comment.