Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds documentation for webpacked web applications #274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ installed.
npm install --save rdflib
```

#### Webpack web applications

This library has some transitive dependencies to other libraries that are primarily designed for Nodejs servers.
Some of these are not needed because the functionality they provide are already provided by the web browser,
while others will and are by design not supposed to work at all.

When using this library in a webpacked web application,
those dependencies must be "externalized" by using the
[`externals` section in the Webpack config](https://webpack.js.org/configuration/externals/):

```javascript
externals: {
'node-fetch': 'fetch',
'text-encoding': 'TextEncoder',
'whatwg-url': 'window',
'isomorphic-fetch': 'fetch',
'@trust/webcrypto': 'crypto'
},
```

## Contribute

#### Subdirectories
Expand Down