Skip to content

Commit 800ed06

Browse files
committed
fix(docs): update script loading paths to use base URL for production
1 parent 4ddc6a9 commit 800ed06

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/src/views/PlaygroundView.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,13 +1168,16 @@ const loadPreset = (preset: string) => {
11681168
// Load legacy v1.x scripts
11691169
const loadLegacyScripts = async () => {
11701170
return new Promise((resolve, reject) => {
1171+
// Get base URL for correct path resolution in production
1172+
const baseUrl = import.meta.env.BASE_URL || '/';
1173+
11711174
// Load Raphael first
11721175
const raphaelScript = document.createElement('script');
1173-
raphaelScript.src = '/raphael.min.js';
1176+
raphaelScript.src = `${baseUrl}raphael.min.js`;
11741177
raphaelScript.onload = () => {
11751178
// Then load JustGage v1
11761179
const justgageScript = document.createElement('script');
1177-
justgageScript.src = '/justgage.js';
1180+
justgageScript.src = `${baseUrl}justgage.js`;
11781181
justgageScript.onload = () => resolve(true);
11791182
justgageScript.onerror = () => reject(new Error('Failed to load justgage.js'));
11801183
document.head.appendChild(justgageScript);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"test:watch": "node --test --watch tests/**/*.test.js",
2929
"lint": "eslint src/ tests/",
3030
"lint:fix": "eslint --fix src/ tests/",
31+
"docs": "cd docs && npm run dev",
3132
"release": "read -p 'GITHUB_TOKEN: ' GITHUB_TOKEN && export GITHUB_TOKEN=$GITHUB_TOKEN && release-it"
3233
},
3334
"repository": {

0 commit comments

Comments
 (0)