File tree Expand file tree Collapse file tree
packages/plugin-rsc/src/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ import path from 'node:path'
55import fs from 'node:fs'
66import * as esModuleLexer from 'es-module-lexer'
77import { transformCjsToEsm } from '../transforms/cjs'
8+ import { createDebug } from '@hiogawa/utils'
9+
10+ const debug = createDebug ( 'vite-rsc:cjs' )
811
912export function cjsModuleRunnerPlugin ( ) : Plugin [ ] {
1013 // use-sync-external-store is known to work fine so don't show warning
@@ -43,7 +46,7 @@ export function cjsModuleRunnerPlugin(): Plugin[] {
4346 // warning once per package
4447 const packageKey = extractPackageKey ( id )
4548 if ( ! warnedPackages . has ( packageKey ) ) {
46- this . warn (
49+ debug (
4750 `Found non-optimized CJS dependency in '${ this . environment . name } ' environment. ` +
4851 `It is recommended to add the dependency to 'environments.${ this . environment . name } .optimizeDeps.include'.` ,
4952 )
You can’t perform that action at this time.
0 commit comments