Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: ignore cjs warning #18660

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
build: ignore cjs warning
  • Loading branch information
bluwy committed Nov 13, 2024
commit f8bc085d0e814587ad5bc8628b22714d23a9780c
2 changes: 2 additions & 0 deletions packages/vite/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -352,6 +352,8 @@ function exportCheck(): Plugin {
async writeBundle() {
// escape import so that it's not bundled while config load
const dynImport = (id: string) => import(id)
// ignore warning from CJS entrypoint to avoid misleading logs
process.env.VITE_CJS_IGNORE_WARNING = 'true'

const esmNamespace = await dynImport('./dist/node/index.js')
const cjsModuleExports = (await dynImport('./index.cjs')).default