Skip to content

Commit

Permalink
fix: remove base option from web
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Jan 15, 2025
1 parent 7b7df99 commit b8e1b70
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/web/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
base: "./",
//base: "./", // this changes the worklet urls..
// with base "./", the worklet URL becomes /node_modules/.vite/deps/assets/worklet-B8fb_TPB.js
// -> new URL("assets/worklet-DzGFm3ry.js", import.meta.url).href
// witout base, the worklet URL becomes /assets/worklet-DzGFm3ry.js
// -> "/assets/worklet-DzGFm3ry.js"
// both don't work out of the box (404), but the latter can be worked around by copying the file to public/assets
// the former doesn't work with copying because it seems node_modules is filtered out when serving files
// all of this is relevant for esm, in cjs it seems to work with base, not sure what happens without...
plugins: [],
build: {
lib: {
Expand Down

0 comments on commit b8e1b70

Please sign in to comment.