Skip to content

Commit

Permalink
fix: import vitePreprocess from vite-plugin-svelte in sveltekit (#…
Browse files Browse the repository at this point in the history
…326)

As of sveltekit v2 `vitePreprocess` is no longer exported from `@sveltejs/kit/vite`, So `vitePreprocess` always is imported from `@sveltejs/vite-plugin-svelte`.
  • Loading branch information
BlankParticle committed Dec 16, 2023
1 parent 51e1083 commit bc96fa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/svelte-add/adder-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const updateSveltePreprocessArgs = async ({ folderInfo, mutateSveltePrepr
await updateJavaScript({
path: cjs ? "/svelte.config.js" : "/svelte.config.js",
async script({ typeScriptEstree }) {
const importFromPackage = folderInfo.kit ? "@sveltejs/kit/vite" : "@sveltejs/vite-plugin-svelte";
const importFromPackage = "@sveltejs/vite-plugin-svelte";

const sveltePreprocessImports = findImport({ cjs, package: importFromPackage, typeScriptEstree });
let sveltePreprocessImportedAs = sveltePreprocessImports.named.vitePreprocess;
Expand Down

0 comments on commit bc96fa1

Please sign in to comment.