when typescript({ content }) {}
replacement is embedded into the automatic preprocessor, it fails with:
and
when replacement is wrapped in typescript()
from svelte-preprocessor
, functions normally.
this seems almost nonsensical but it's reproducible.
rollup.config.js
// import spp from "svelte-preprocess";
// import { typescript } from "svelte-preprocess"
// ...
preprocess: [
typescript({
typescript({ content }) {
const { code, map } = transformSync(content, {
loader: "ts",
});
return { code, map };
}
}),
spp({
typescript: false
}),
],
// ...
rollup.config.js
// import spp from "svelte-preprocess";
// ...
preprocess: [
spp({
typescript({ content }) {
const { code, map } = transformSync(content, {
loader: "ts",
});
return { code, map };
}
}),
],
// ...
git clone [email protected]:endigma/svelte-esbuild.git
cd svelte-esbuild
yarn install
yarn dev # or yarn build