12 lines
314 B
JavaScript
12 lines
314 B
JavaScript
|
const { compile } = require("svelte/compiler")
|
||
|
const { transformSync } = require("@babel/core")
|
||
|
|
||
|
module.exports = {
|
||
|
process(sourceText) {
|
||
|
const { js } = compile(sourceText, { css: "injected", generate: "ssr" })
|
||
|
const { code } = transformSync(js.code, { babelrc: true })
|
||
|
|
||
|
return { code: code }
|
||
|
},
|
||
|
}
|