From d079756fa8259837d380755628739c63965c2f6d Mon Sep 17 00:00:00 2001 From: Sebastian Rothe Date: Sun, 23 Jul 2023 23:08:47 +0200 Subject: [PATCH] feat: remove * import for treeshaking --- src/transformer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformer.js b/src/transformer.js index d8277bc..75c4f89 100644 --- a/src/transformer.js +++ b/src/transformer.js @@ -1,7 +1,7 @@ import { execSync } from 'child_process' import { basename, extname } from 'path' import { pathToFileURL } from 'url' -import * as svelte from 'svelte/compiler' +import { compile, preprocess as sveltePreprocess } from 'svelte/compiler' import { getSvelteConfig } from './svelteconfig.js' @@ -32,7 +32,7 @@ const processAsync = async (source, filename, jestOptions) => { const svelteConfigPath = getSvelteConfig(rootMode, filename, preprocess) const svelteConfig = await dynamicImport(svelteConfigPath) - const processed = await svelte.preprocess( + const processed = await sveltePreprocess( source, svelteConfig.default.preprocess || {}, { filename } @@ -96,7 +96,7 @@ const compiler = (format, options = {}, filename, processedCode, processedMap) = let result try { - result = svelte.compile(processedCode, opts) + result = compile(processedCode, opts) } catch (error) { let msg = error.message if (error.frame) {