Skip to content

Commit

Permalink
Fix compileScript not having an fs
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
pipe01 committed Jan 22, 2024
1 parent e4b8de2 commit a625c40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as path from "path";
import * as fs from 'fs';
import * as crypto from "crypto";

import ts from "typescript";

import * as sfc from '@vue/compiler-sfc';
import * as core from '@vue/compiler-core';

Expand Down Expand Up @@ -136,7 +138,7 @@ const vuePlugin = (opts: Options = {}) => <esbuild.Plugin>{
const { descriptor } = sfc.parse(source, {
filename
});
const script = (descriptor.script || descriptor.scriptSetup) ? sfc.compileScript(descriptor, { id }) : undefined;
const script = (descriptor.script || descriptor.scriptSetup) ? sfc.compileScript(descriptor, { id, fs: ts.sys }) : undefined;

const dataId = "data-v-" + id;
let code = "";
Expand Down

0 comments on commit a625c40

Please sign in to comment.