You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bundler - Module bundlers are tools frontend developers used to bundle JavaScript modules into a single JavaScript files that can be executed in the browser.
9
+
10
+
package.json fields -
11
+
* main - The main field is a module ID that is the primary entry point to your program. Points to the CJS modules.
12
+
13
+
* module - The module field is not an official npm feature but a common convention among bundlers to designate how to import an ESM version of a library. Points to the ES modules.
14
+
15
+
* browser - If your module is meant to be used client-side the browser field should be used instead of the main field.
16
+
17
+
Current set up -
18
+
19
+
1.
20
+
TypeScript Source Code
21
+
/ \
22
+
Transpiles into JavaScript
23
+
/ \
24
+
CJS module ES modules
25
+
2. main - `lib/src/index.js`
26
+
module - `lib/src/es/index.js`
27
+
28
+
3. Rollup bundling output
29
+
* graph-js-sdk.js - IIFE bundled file. This file can be directly used in the browser with a `<script>` tag.
30
+
* graph-es-sdk.js - ES bundled file.
31
+
4. Entry point for rollup - `lib/es/browser/index.js`.
32
+
5.
33
+
34
+
Upcoming changes -
35
+
36
+
1. Bundle the authproviders serately as they are optional.
0 commit comments