Skip to content

Commit

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

* 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
2 people authored and Interpause committed Aug 7, 2022
1 parent 5806957 commit 9b00c23
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 9b00c23

Please sign in to comment.