Skip to content

Commit

Permalink
fix: style.css import in devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
Gugustinette committed Nov 22, 2024
1 parent 0e43b1e commit 434e7f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/devtools/src/FDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ export class FDebug {
FLogger.error(...args)
}

// Fetch the CSS
fetch(import.meta.url.replace('index.es.js', 'style.css'))
// import.meta.url will typically be something like :
// In local playground : http://localhost:5173/playground-3d/@fs/Users/[USERNAME]/Desktop/fibbo/packages/devtools/dist/index.es.js?t=1732299741683
// In development : http://localhost:5173/starter-3d/node_modules/.vite/deps/@fibbojs_devtools.js?v=6af81429
const URL = import.meta.url.includes('/packages/devtools/dist/index.es.js')
? import.meta.url.replace('/packages/devtools/dist/index.es.js', '/packages/devtools/dist/style.css')
: `${import.meta.url.split('/node_modules/')[0]}/node_modules/@fibbojs/devtools/dist/style.css`
// Fetch the CSS file
fetch(URL)
.then(res => res.text())
.then((css) => {
// Extract the CSS content
Expand Down

0 comments on commit 434e7f1

Please sign in to comment.