Skip to content

Commit 51fef1c

Browse files
committed
refactor(svelte): dynamically import sveltePreprocess
This commit changes the import of `sveltePreprocess` from a static import to a dynamic one. This is done in the `preprocess` function in `svelte.ts`. The change could potentially improve the load time and overall performance of the application.
1 parent 0433945 commit 51fef1c

File tree

1 file changed

+1
-1
lines changed
  • packages/unplugin-typia/src/core/languages

1 file changed

+1
-1
lines changed

packages/unplugin-typia/src/core/languages/svelte.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { preprocess as sveltePreprocess } from 'svelte/compiler';
21
import type { Data, ID, Source } from '../types.js';
32
import { wrap } from '../types.js';
43

@@ -24,6 +23,7 @@ export async function preprocess(
2423
{ source, id, transform }:
2524
{ source: Source; id: ID; transform: TransformFunction },
2625
): Promise<{ code: Data }> {
26+
const { preprocess: sveltePreprocess } = await import('svelte/compiler');
2727
const { code } = await sveltePreprocess(source, {
2828
script: async ({ content, filename, attributes }) => {
2929
if (filename == null) {

0 commit comments

Comments
 (0)