Closed
Description
import { createApp } from 'vue'
import Index from '/src/options/index.vue'
const app = createApp(Index)
app.mount('#root')
// The same is true for other onloads
build.onLoad({filter: /\.vue$/, namespace: "vue"}, async (args) => {
// args.path === '/src/options/index.vue'
// The original code will report an error
// no such file or directory, open '/src/options/index.vue'
const content = await fs.promises.readFile(args.path, "utf8");
// temporary solution
const content = await fs.promises.readFile(path.join(process.cwd(), args.path), "utf8");
// In fact, we should consider relative path, absolute path and alias,
// but we can't get other information through args
// ...
}
Metadata
Metadata
Assignees
Labels
No labels