File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,23 @@ function preactPlugin({
153
153
build : {
154
154
rollupOptions : {
155
155
onwarn ( warning , warn ) {
156
- // Silence Rollup's module-level directive warnings -- they're likely
157
- // to all come from `node_modules` (RSCs) and won't be actionable.
158
- if ( warning . code === "MODULE_LEVEL_DIRECTIVE" ) return ;
156
+ // Silence Rollup's module-level directive warnings re:"use client".
157
+ // They're likely to come from `node_modules` and won't be actionable.
158
+ if (
159
+ warning . code === "MODULE_LEVEL_DIRECTIVE" &&
160
+ warning . message . includes ( "use client" )
161
+ )
162
+ return ;
163
+ // ESBuild seemingly doesn't include mappings for directives, causing
164
+ // Rollup to emit warnings about missing source locations. This too is
165
+ // likely to come from `node_modules` and won't be actionable.
166
+ // evanw/esbuild#3548
167
+ if (
168
+ warning . code === "SOURCEMAP_ERROR" &&
169
+ warning . message . includes ( "resolve original location" ) &&
170
+ warning . pos === 0
171
+ )
172
+ return ;
159
173
warn ( warning ) ;
160
174
} ,
161
175
} ,
You can’t perform that action at this time.
0 commit comments