From 3e685f76e81eb475e75eea14ba6f772d14dd2ee9 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 15 Dec 2022 01:02:18 +0100 Subject: [PATCH] don't transpile imports to requires. --- .babelrc.js | 5 ++++- src/preset/index.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.babelrc.js b/.babelrc.js index b155663..3806668 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -1,5 +1,8 @@ module.exports = { - presets: [['@babel/preset-env', { targets: { node: '16' } }], '@babel/preset-typescript'], + presets: [ + ['@babel/preset-env', { targets: { node: '16' }, modules: false }], + '@babel/preset-typescript', + ], plugins: ['@babel/plugin-transform-runtime'], env: { esm: { diff --git a/src/preset/index.js b/src/preset/index.js index 359823d..5ae892e 100644 --- a/src/preset/index.js +++ b/src/preset/index.js @@ -41,7 +41,7 @@ export async function viteFinal(config, options) { } } - const { default: svelteCsfPlugin } = await import('../plugins/vite-svelte-csf'); + const svelteCsfPlugin = (await import('../plugins/vite-svelte-csf.js')).default.default; plugins.push(svelteCsfPlugin(svelteConfig)); return {