Skip to content

Commit

Permalink
🔧 Export file to CJS
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutonbrady committed Jul 12, 2020
1 parent 19cd994 commit fb5ed9c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 39 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"access": "public"
},
"files": [
"lib/"
"lib"
],
"types": "lib",
"types": "lib/plugin.d.ts",
"scripts": {
"build": "tsc"
},
Expand Down
2 changes: 2 additions & 0 deletions playground/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const rootEl = document.getElementById("app");
const dispose = render(() => App, rootEl);

// HMR stuff, this will be automatically removed during build
// /!\ You need to add "vite" in the "compilerOptions.types" of your tsconfig.json
// if you want to avoid type errors here
if (import.meta.hot) {
import.meta.hot.accept();
import.meta.hot.dispose(() => {
Expand Down
2 changes: 1 addition & 1 deletion playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UserConfig } from "vite";
import { solidPlugin } from "../lib/plugin";
const { solidPlugin } = require("../lib/plugin"); // This should work witrh import {} from '..'

const config: UserConfig = {
root: "src",
Expand Down
Loading

0 comments on commit fb5ed9c

Please sign in to comment.