Skip to content

Commit

Permalink
Fix build problems
Browse files Browse the repository at this point in the history
  • Loading branch information
bgonp committed Jan 29, 2021
1 parent 0e1c2b2 commit b430961
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require("esbuild")
.build({
entryPoints: ["src/index.ts"],
format: "esm",
bundle: true,
minify: true,
outfile: "build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "./build/index.d.ts",
"scripts": {
"prepare": "npm run build",
"build": "node esbuild.js && tsc src/index.ts --declaration --emitDeclarationOnly --outFile build/index.d.ts --lib es2015,dom"
"build": "node esbuild.js && tsc src/index.ts --declaration --emitDeclarationOnly --resolveJsonModule --outFile build/index.d.ts --lib es2015,dom"
},
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useLocalStorage } from "./useLocalStorage";
import { name } from '../package.json'

if (typeof window === "undefined") {
throw new Error("bgon/custom-hooks package can only be executed on browser");
throw new Error(`${name} package can only be used on browser`);
}

export default {
Expand Down

0 comments on commit b430961

Please sign in to comment.