vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.

Home Page:https://vike.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New setting `cjsInterop`

brillout opened this issue · comments

commented

Description

// vike.config.js

export default {
  fixNpmPackages: ['some-npm-package']
}

Vike would then:

TODO: Vite currently fails when adding a CJS package to ssr.noExternal, check whether Vite has plans to support executing CJS server-side code.

Edit: a new config cjsInterop would probably be better. Setting it to true would automatically apply it (by dynamically checking whether a package is CJS).