Skip to content

Commit

Permalink
Pushing in hotfix for loading ESM modules when the project using the …
Browse files Browse the repository at this point in the history
…library has type:module set in the package.json. Changing the extension to .mjs fixes the issue.
  • Loading branch information
Kabe0 committed Mar 12, 2022
1 parent 355bfc2 commit eda90e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "3.0.2",
"description": "A Rollup plugin to import CSS into JavaScript",
"main": "dist/plugin.cjs.js",
"module": "dist/plugin.esm.js",
"module": "dist/plugin.esm.mjs",
"types": "types/plugin.d.ts",
"scripts": {
"build": "rollup -c",
Expand All @@ -23,8 +23,8 @@
"exports": {
".": {
"require": "./dist/plugin.cjs.js",
"import": "./dist/plugin.esm.js",
"default": "./dist/plugin.esm.js"
"import": "./dist/plugin.esm.mjs",
"default": "./dist/plugin.esm.mjs"
}
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { builtinModules } from "module";
export default {
input: "src/index.js",
output: [
{ file: "dist/plugin.esm.js", format: "esm" },
{ file: "dist/plugin.esm.mjs", format: "esm" },
{ file: "dist/plugin.cjs.js", format: "cjs", exports: "default" },
],
plugins: [
Expand Down

0 comments on commit eda90e6

Please sign in to comment.