File tree Expand file tree Collapse file tree 4 files changed +16
-15
lines changed
Expand file tree Collapse file tree 4 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,21 @@ export function baseBuildConfig(nitro: Nitro) {
4646
4747 const noExternal : RegExp [ ] = getNoExternals ( nitro ) ;
4848
49+ const ignoreWarningCodes = new Set ( [
50+ "EVAL" ,
51+ "CIRCULAR_DEPENDENCY" ,
52+ "THIS_IS_UNDEFINED" ,
53+ "EMPTY_BUNDLE" ,
54+ ] ) ;
55+
4956 return {
5057 extensions,
5158 isNodeless,
5259 replacements,
5360 env,
5461 aliases,
5562 noExternal,
63+ ignoreWarningCodes,
5664 } ;
5765}
5866
Original file line number Diff line number Diff line change @@ -38,12 +38,8 @@ export const getRolldownConfig = (nitro: Nitro): RolldownOptions => {
3838 } ,
3939 } ,
4040 onwarn ( warning , warn ) {
41- if (
42- ! [ "CIRCULAR_DEPENDENCY" , "EVAL" , "EMPTY_CHUNK" ] . includes (
43- warning . code || ""
44- ) &&
45- ! warning . message . includes ( "Unsupported source map comment" )
46- ) {
41+ if ( ! base . ignoreWarningCodes . has ( warning . code || "" ) ) {
42+ console . log ( warning . code ) ;
4743 warn ( warning ) ;
4844 }
4945 } ,
Original file line number Diff line number Diff line change @@ -53,15 +53,7 @@ export const getRollupConfig = (nitro: Nitro): RollupConfig => {
5353 ( inject as unknown as typeof inject . default ) ( base . env . inject ) ,
5454 ] ,
5555 onwarn ( warning , rollupWarn ) {
56- if (
57- ! [
58- "EVAL" ,
59- "CIRCULAR_DEPENDENCY" ,
60- "THIS_IS_UNDEFINED" ,
61- "EMPTY_CHUNK" ,
62- ] . includes ( warning . code || "" ) &&
63- ! warning . message . includes ( "Unsupported source map comment" )
64- ) {
56+ if ( ! base . ignoreWarningCodes . has ( warning . code || "" ) ) {
6557 rollupWarn ( warning ) ;
6658 }
6759 } ,
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ export const getViteRollupConfig = (
3939 return nitro . options . moduleSideEffects . some ( ( p ) => id . startsWith ( p ) ) ;
4040 } ,
4141 } ,
42+ onwarn ( warning , warn ) {
43+ if ( ! base . ignoreWarningCodes . has ( warning . code || "" ) ) {
44+ warn ( warning ) ;
45+ }
46+ } ,
4247 output : {
4348 format : "esm" ,
4449 entryFileNames : "index.mjs" ,
You can’t perform that action at this time.
0 commit comments