Skip to content

Commit

Permalink
Beta Browser Support
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Best-Codes committed Jul 25, 2024
1 parent 70bfd93 commit 0c35b00
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/browser/best-bible.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/browser/best-bible.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build:cjs": "tsc --project tsconfig.cjs.json || true && mkdir -p dist/cjs/data && cp src/data/bible.json dist/cjs/data/",
"build:esm": "tsc --project tsconfig.esm.json || true && mkdir -p dist/esm/data && cp src/data/bible.json dist/esm/data/",
"build:browser": "esbuild src/index.js --bundle --minify --sourcemap --platform=browser --target=es2015 --outfile=dist/browser/best-bible.min.js",
"build:browser": "esbuild src/browser.ts --bundle --minify --sourcemap --format=iife --global-name=BestBible --platform=browser --target=es2015 --outfile=dist/browser/best-bible.min.js",
"build": "npm run build:cjs && npm run build:esm && npm run build:browser",
"prepublishOnly": "npm run build"
},
Expand Down
17 changes: 17 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { getVerse, getChapter, getBook, getRange, getChapterCount, getVerseCount, getBibleBooks, searchVerse, parseVerse, resolveAbbreviation, bibleStats, bibleValidation } from './index';

// Expose the functions to the global scope
(window as any).BestBible = {
getVerse,
getChapter,
getBook,
getRange,
getChapterCount,
getVerseCount,
getBibleBooks,
searchVerse,
parseVerse,
resolveAbbreviation,
bibleStats,
bibleValidation
};
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"allowJs": true
},
"include": ["src"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules", "src/browser.ts"]
}

0 comments on commit 0c35b00

Please sign in to comment.