Fix(Preview): Fixed code pollution bug
Methods and variables in base and main code are isolated to solve the problem of code pollution. Close #4
This commit is contained in:
@@ -145,7 +145,7 @@ const Create = () => {
|
||||
.compile(files, importMap, template.entryPoint)
|
||||
.then((result) => {
|
||||
const output = result.outputFiles[0].text
|
||||
setCompiledCode(`${output}\n${baseDist}`)
|
||||
setCompiledCode(`(() => {${output}})();\n(() => {${baseDist}})();`)
|
||||
})
|
||||
.catch((reason) => {
|
||||
void message.error(`编译失败:${reason}`)
|
||||
|
||||
Reference in New Issue
Block a user