File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
packages/cli/generate-svg-config/src/utils Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -481,11 +481,21 @@ export const updateNextConfig = (
481481} ;
482482
483483// 확장자별로 next.config 파일을 쉽게 셋업하는 헬퍼 함수
484- export const setupNextSvgr = (
485- lang : 'js' | 'mjs' | 'ts' ,
486- useTurbopack : boolean
487- ) : void => {
488- const fileName = `next.config.${ lang } ` ;
489- const configPath = path . resolve ( process . cwd ( ) , fileName ) ;
490- updateNextConfig ( configPath , useTurbopack ) ;
484+ export const setupNextSvgr = ( useTurbopack : boolean ) : void => {
485+ const candidateFiles = [
486+ 'next.config.ts' ,
487+ 'next.config.js' ,
488+ 'next.config.mjs' ,
489+ ] ;
490+ const foundConfigFile = candidateFiles . find ( file =>
491+ fs . existsSync ( path . resolve ( process . cwd ( ) , file ) )
492+ ) ;
493+ if ( ! foundConfigFile ) {
494+ console . error (
495+ '❌ next.config.ts 또는 next.config.js 또는 next.config.mjs 파일을 찾을 수 없습니다.'
496+ ) ;
497+ return ;
498+ }
499+ const resolvedConfigPath = path . resolve ( process . cwd ( ) , foundConfigFile ) ;
500+ updateNextConfig ( resolvedConfigPath , useTurbopack ) ;
491501} ;
You can’t perform that action at this time.
0 commit comments