-
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.
🔨 [#724] Set up npm package build with Vite
Slowly preparing to swap over the ESM build for the NPM package from CRA/webpack to Vite. This configuration was hand-crafted. Initially the library build config was used/attempted (see https://v5.vite.dev/config/build-options.html#build-lib), but this proved not to be acceptable since it would inline all the font assets, which blows up the CSS file size to unacceptable sizes. This is very inefficient, since all the font assets would be loaded, even if the browser only requires one type (woff2 vs ttf etc.). It was also inlining the leaflet static images. Using vitejs/vite#3295 (comment) as a reference (which crucially doesn't define build.lib) allows us to configure the underlying rollup setup without inlining assets.
- Loading branch information
1 parent
e473e32
commit d5b0382
Showing
2 changed files
with
42 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 |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
/storybook-static | ||
/build | ||
/dist | ||
/dist-vite | ||
/lib | ||
/esm | ||
*.tgz | ||
|
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