Skip to content

Commit

Permalink
chore: support cjs in all sourcecode that is not external
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebodin committed Sep 11, 2024
1 parent 780b377 commit e9aa661
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node/tasks/vite/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const resolveViteConfig = async (ctx: BuildContext, task: ViteBaseTask) => {
emptyOutDir: false,
target: targets[runtime],
outDir,
commonjsOptions: {
include: [/node_modules/, `${ctx.cwd}/**/*`],
extensions: ['.js', '.jsx', '.cjs'],
},
lib: {
entry: entries.map((e) => e.entry),
formats: [format],
Expand Down

0 comments on commit e9aa661

Please sign in to comment.