Skip to content

Commit

Permalink
fix: ESM export and export all related structures
Browse files Browse the repository at this point in the history
  • Loading branch information
zaid450 committed Sep 25, 2020
1 parent 8eef561 commit 03eb456
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tests/
node_modules/
dist/
esm/
*.config.js
13 changes: 11 additions & 2 deletions esm/index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
const {QuizizzClient} = require("../dist/index.js");
const QuizizzJS = require("../dist/index.js");

export { QuizizzClient };
export const QuizizzJS;

export const {
QuizizzClient,
Question,
User,
Quiz,
Structure,
RequestError
} = QuizizzJS
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require": "./dist/index.js"
},
"scripts": {
"build": "tsc",
"build": "tsc --project tsconfig.json",
"test": "npm run build && npm run test",
"lint": "npx eslint src/ --fix",
"docs": "typedoc --options typedoc.json"
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import QuizizzClient from "./QuizizzClient";
import Question from "./structures/Question";
import Quiz from "./structures/Quiz";
import RequestError from "./structures/RequestError";
import Structure from "./structures/Structure";
import User from "./structures/User";

export { QuizizzClient };
export { QuizizzClient, Question, User, Quiz, Structure, RequestError };

0 comments on commit 03eb456

Please sign in to comment.