Skip to content

Commit

Permalink
Do not depend on node based modules in browser environments
Browse files Browse the repository at this point in the history
Webpack defines the global "process" variable so just checking for that is not enough to check the environment.
Add check for process.browser to make it strong.

Fixes #57
  • Loading branch information
aadsm committed Jul 16, 2017
1 parent fc5e81b commit a13c345
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/jsmediatags.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,8 @@ Config
.addTagReader(ID3v1TagReader)
.addTagReader(MP4TagReader);

if (typeof process !== "undefined") {
Config
.addFileReader(NodeFileReader);
if (typeof process !== "undefined" && !process.browser) {
Config.addFileReader(NodeFileReader);
}

module.exports = {
Expand Down

0 comments on commit a13c345

Please sign in to comment.