-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add index files to bundles (#223)
This allows more visually appealing imports when used with bundlers: ```typescript // Old, but still works: import * as vis from "vis-network/standalone/esm/vis-network"; // New, achieving the same result (ESM): import * as vis from "vis-network/standalone"; // ESM explicitly: import * as vis from "vis-network/standalone/esm"; // UMD explicitly: import * as vis from "vis-network/standalone/umd"; ``` This partially works in HTML but the old way is preferred (less requests, library name in dev tools and better compatibility): ```html <!-- Old, still works. Recommended. --> <script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js" ></script> <!-- New, works but has issues. Not recommended. --> <script type="module" src="https://unpkg.com/vis-network/standalone/esm" ></script> <!-- New, doesn't work. --> <script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd" ></script> ```
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./vis-network.css"; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./esm"; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./vis-network"; |
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