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:
@@ -32,7 +32,7 @@ const Preview = ({
|
||||
Compiler.compile(files, importMap, entryPoint)
|
||||
.then((result) => {
|
||||
setCompiledCode(
|
||||
`${preExpansionCode}\n${result.outputFiles[0].text}\n${postExpansionCode}`
|
||||
`(()=>{${preExpansionCode}})();\n(()=>{${result.outputFiles[0].text}})();\n(()=>{${postExpansionCode}})();`
|
||||
)
|
||||
setErrorMsg('')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user