Skip to content

Commit

Permalink
add named export to improve "module": "nodenext" compatibility (#48)
Browse files Browse the repository at this point in the history
* add named export to improve `"module": "nodenext"` compatibility

* add proper types export

* Update src/index.ts

Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>

Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
  • Loading branch information
wight554 and JoviDeCroock committed Jul 16, 2022
1 parent 91bdb5b commit 11d8bb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -7,7 +7,8 @@
"exports": {
".": {
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
},
"./package.json": "./package.json"
},
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Expand Up @@ -50,7 +50,7 @@ export interface PreactBabelOptions extends BabelOptions {
}

// Taken from https://github.com/vitejs/vite/blob/main/packages/plugin-react/src/index.ts
export default function preactPlugin({
function preactPlugin({
devtoolsInProd,
include,
exclude,
Expand Down Expand Up @@ -168,3 +168,6 @@ export default function preactPlugin({
prefresh({ include, exclude }),
];
}

export default preactPlugin;
export { preactPlugin as preact };

0 comments on commit 11d8bb0

Please sign in to comment.