Skip to content

Commit

Permalink
fix(docs): raw-source import of server.cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Dec 15, 2024
1 parent 7861bcb commit 3a2189e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/docs/vite.repl-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,15 @@ export function rawSource(): Plugin {
if (path.startsWith('/@fs/')) {
path = path.slice('/@fs'.length);
}
if (path.startsWith('\x00')) {
// let's just assume it's a path
path = path.slice(1);
}
if (isDev) {
const devUrl = `${base}@raw-fs${path}`;
return `export default "${devUrl}";`;
}
const fileContent = readFileSync(path);
const fileContent = readFileSync(path, 'utf-8');
const ref = this.emitFile({
type: 'asset',
name: basename(path),
Expand Down

0 comments on commit 3a2189e

Please sign in to comment.