-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: browser field should point to cjs (#20)
> a top-level "browser" field should point to CJS files that, when bundled by a non-broken module bundler, work in a browser browserify/browser-resolve#101 (comment) I've changed the `browser` field to point to the `cjs` version of this module in line with the above comment because this module is currently broken when used with browserify. I've also added the [util](https://www.npmjs.com/package/util) module as a dep since it's used in the code. It would be ignored in most environments so the only cost is a slightly larger bundle but it's likely to be included in any non-trivial bundle somewhere anyway so there's likely to be no real-world impact. Also: - Adds typescript dep to tests that test typescript, otherwise tests fail with 'cannot determine executable to run' - unless you have tsc installed globally I guess? - Fixes a typo in a comment - Simplifies .gitignore Fixes #19
- Loading branch information
1 parent
77028b0
commit 3992702
Showing
7 changed files
with
6,592 additions
and
6,449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
node_modules/** | ||
test/**/package-lock.json | ||
**/node_modules | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
"react-native": "./src/lib.react-native.js", | ||
"main": "./src/lib.cjs", | ||
"module": "./src/lib.js", | ||
"browser": "./src/lib.js", | ||
"browser": "./src/lib.cjs", | ||
"types": "./src/lib.d.ts", | ||
"exports": { | ||
".": { | ||
|
@@ -33,6 +33,9 @@ | |
"license": "MIT", | ||
"author": "Irakli Gozalishvili <[email protected]>", | ||
"homepage": "https://github.com/gozala/web-encoding", | ||
"dependencies": { | ||
"util": "^0.12.3" | ||
}, | ||
"devDependencies": { | ||
"assert": "^2.0.0", | ||
"jest": "^26.6.3", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters