๋ฒ๊ทธ ์ค๋ช
VSCode์ ์ค๋ฅ๊ฐ ์์ง๋ง ๋ชจ๋ ๊ฒ์ด ์ปดํ์ผ๋๊ณ ์๋ํฉ๋๋ค.
์ค๋ฅ ๋ฉ์์ง : "Module '"/home/scippio/..../src/Test.svelte "'has no default export.ts (1192)"
App.svelte
<script type="text/typescript">
import Test, { getText } from './Test.svelte'
export let name: string = 'world'
console.log(Test)
</script>
<h1>Hello {name}! this is: {getText()}</h1>
<Test></Test>
Test.svelte
<script context="module" type="text/typescript">
export function getText(): string {
return "getText called..."
}
</script>
<script type="text/typescript">
import { onMount } from 'svelte'
onMount(async () => {
console.log("Test init...")
})
</script>
<b>just test</b>
svelte.config.js
// svelte.config.js
const sveltePreprocess = require('svelte-preprocess');
module.exports = {
preprocess: sveltePreprocess({
typescript: {
// transpileOnly: true
// allowSyntheticDefaultImports: true
}
// ...svelte-preprocess options
}),
// ...other svelte options
};
๋ฒ์ : 1.46.0-inider
์ปค๋ฐ : 6849775440496504e0677ffcf2a46d47ad9130f5
๋ ์ง : 2020-05-15T05 : 29 : 39.210Z
์ ์ : 7.2.4
ํฌ๋กฌ : 78.0.3904.130
Node.js : 12.8.1
V8 : 7.8.279.23- ์ ์ .0
์ด์์ฒด์ : Linux x64 5.4.40-1-lts
"Svelte Beta"๋ง ์ค์นํ์ฌ ํ์ธํ ์ ์์ต๋๊น? ๊ฐ ํ์ฅ ํ๋ก๊ทธ๋จ์ ์์ ์ ์์ ์ ์๋ํฉ๋๋ค.
"Svelte"ํ์ฅ์ ๋ฌธ์ ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋นํ์ฑํํ์ ๋ ๊ฒฝ๊ณ ๊ฐ ์ฌ๋ผ์ก์ต๋๋ค ...
Tahnk ๋น์ !
...์ด ๋ฌธ์ ๋ฅผ ์์ํ๊ธฐ ์ ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ง ์์์ ์ฃ์กํฉ๋๋ค.
๋ฌธ์ ์์ด์!
ํ์ฌ Svelte Beta๋ ๊ณต์์ ์ด๊ณ ํ๋ฐํ๊ฒ ๊ฐ๋ฐ ๋ ํ๋ฌ๊ทธ์ธ์
๋๋ค. "Svelte"๋ ์ด์ ๋ฒ์ ์
๋๋ค. ๋์ค์์ด๋ฅผ ์ธ์ํ์ฌ ์
๋ฐ์ดํธ๋ฅผ ๊ฒ์ ํ ์๋ ์์ต๋๋ค. Svelte Typechecker๋ ํ๋ typescript ์ง์์ผ๋ก Svelte Beta๋ณด๋ค ์์ ์์์ง๋ง ์ด์ Svelte Beta๋ ๋ณธ์ง์ ์ผ๋ก ๋์ผํ ์์
์ ์ํํฉ๋๋ค.
๊ฐ๋จํ ๋งํด์ "Svelte"๋ฐ "Svelte Typechecker"๋ฅผ ์ ๊ฑฐ ํ ์ ์์ต๋๋ค. ๋นํ์ฑํ ํ ๊ฒฝ์ฐ ๋์ค์ Svelte Beta์์ ์คํฌ๋ฆฝํธ๋ฅผ ๋ค์ ํ์ฑํํ๋ ๊ฒ์ ์์ง ๋ง์ญ์์ค.