Commit 5384eda
fix(website): prefix astrochart.js path with BASE_URL
The bundle was hard-coded as '/astrochart.js' (root-relative) in
ChartDemo.astro. With base: '/AstroChart' in astro.config.mjs the
file is deployed at /AstroChart/astrochart.js, so the browser was
requesting the wrong path and getting a 404.
Pass import.meta.env.BASE_URL into the is:inline script via
define:vars and prefix both the querySelector guard and the dynamic
script.src with it. Astro guarantees BASE_URL ends with '/', so
concatenating 'astrochart.js' produces the correct path.
🤖 Generated with [eca](https://eca.dev)
Co-Authored-By: eca <git@eca.dev>1 parent f130b50 commit 5384eda
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
0 commit comments