Closed Barbapapazes closed 1 week ago
It seems to be related to a commonjs dependencies: https://vitejs.dev/config/dep-optimization-options#optimizedeps-include:~:text=CommonJS,js
By using the following vite.config.js
, it works:
import { defineConfig } from 'vite'
export default defineConfig({
optimizeDeps: {
include: [
'my-addon > pusher-js',
'my-addon > to-px',
'my-addon > striptags',
],
},
})
Describe the bug
Hello 👋,
I'm building an addon for Slidev but I have the following issue:
This occurs when using the following syntax:
BUT it works correctly (no import issue) with the following syntax
Minimal reproduction
Steps to reproduce the behavior:
You can use https://sli.dev/new to create a new project to reproduce the issue.
Environment
If you are using Slidev globally (i.e.
npx slidev
ornpm i -g slidev
), please try to reproduce the issue in a local project (i.e.npm create slidev@latest
).