Skip to content

Commit

Permalink
Remove module export aliases
Browse files Browse the repository at this point in the history
BREAKING CHANGE: After exporting a js and css export alias, I realized that export aliases are really stupid.
Files are now exposed consistently across cjs and module mode by referencing file paths only. Sorry for the version thrash.
  • Loading branch information
bcomnes committed Jan 23, 2023
1 parent 69a56a1 commit 8aa4d08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -58,12 +58,14 @@ If your bundler implements package.json `exports` resolution, you can explicitly

```css
/* esbuild css */
@import 'mine.css/css';
@import 'mine.css/dist/mine.css';
```

```js
/* esbuild js */
import { toggleTheme } from 'mine.css/js';
import { toggleTheme } from 'mine.css/dist/theme-switcher.js';
/* or */
import { toggleTheme } from 'mine.css';
```

## Usage
Expand Down
10 changes: 6 additions & 4 deletions package.json
Expand Up @@ -43,12 +43,14 @@
"type": "module",
"main": "dist/theme-switcher.js",
"module": "dist/theme-switcher.js",
"style": "dist/mine.css",
"exports": {
".": "./dist/theme-switcher.js",
"./js": "./dist/theme-switcher.js",
"./css": "./dist/mine.css"
".": {
"default": "./dist/theme-switcher.js"
},
"./dist/theme-switcher.js": "./dist/theme-switcher.js",
"./dist/mine.css": "./dist/mine.css"
},
"style": "dist/mine.css",
"repository": {
"type": "git",
"url": "https://github.com/bcomnes/mine.css.git"
Expand Down

0 comments on commit 8aa4d08

Please sign in to comment.