Skip to content

Commit

Permalink
fix: 支持 setup
Browse files Browse the repository at this point in the history
Fixed xitu#4
  • Loading branch information
不忧 committed Jul 27, 2024
1 parent 8968cbe commit 01b3f8b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ function transformVueSFC(source, filename, mountname) {
if(script.map) {
script.content = `${script.content}\n//# sourceMappingURL=data:application/json;base64,${toBase64(JSON.stringify(script.map))}`;
}
const template = compiler.compileTemplate({...templateOptions, sourceMap: true});
const template = compiler.compileTemplate({
...templateOptions,
sourceMap: true,
compilerOptions: {
...templateOptions.compilerOptions,
// https://github.com/vuejs/repl/blob/2daac718a212e61d200cecdfc3623535bd0196a9/src/transform.ts#L167C7-L167C15
bindingMetadata: script.bindings,
}
});
if(template.map) {
template.map.sources[0] = `${template.map.sources[0]}?template`;
template.code = `${template.code}\n//# sourceMappingURL=data:application/json;base64,${toBase64(JSON.stringify(template.map))}`;
Expand Down

0 comments on commit 01b3f8b

Please sign in to comment.