File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -71,18 +71,38 @@ export const getRollupOptions = (
7171 // Investigate if we can use this to leverage Stencil's in-memory fs
7272 } ;
7373
74+ // @ts -expect-error - this is required now.
75+ nodeResolvePlugin . warn = ( log ) => {
76+ const onWarn = createOnWarnFn ( buildCtx . diagnostics ) ;
77+ if ( typeof log === 'string' ) {
78+ onWarn ( { message : log } ) ;
79+ } else if ( typeof log === 'function' ) {
80+ const result = log ( ) ;
81+ if ( typeof result === 'string' ) {
82+ onWarn ( { message : result } ) ;
83+ } else {
84+ onWarn ( result ) ;
85+ }
86+ } else {
87+ onWarn ( log ) ;
88+ }
89+ } ;
90+
7491 assertIsObjectHook ( nodeResolvePlugin . resolveId ) ;
7592 // remove default 'post' order
7693 nodeResolvePlugin . resolveId . order = null ;
7794 const orgNodeResolveId = nodeResolvePlugin . resolveId . handler ;
95+
7896 const orgNodeResolveId2 = ( nodeResolvePlugin . resolveId . handler = async function ( importee : string , importer : string ) {
7997 const [ realImportee , query ] = importee . split ( '?' ) ;
8098 const resolved = await orgNodeResolveId . call (
8199 nodeResolvePlugin as unknown as PluginContext ,
82100 realImportee ,
83101 importer ,
84- // @ts -expect-error - missing required properties but works in practice
85- { } ,
102+ {
103+ attributes : { } ,
104+ isEntry : true ,
105+ } ,
86106 ) ;
87107 if ( resolved ) {
88108 if ( isString ( resolved ) ) {
Original file line number Diff line number Diff line change 33// `stencil-sibling` test suite
44import '@test-sibling' ;
55import { setMode } from '@stencil/core' ;
6+ // @ts -expect-error - tests that rollup warnings don't break the build
7+ import { setAssetPath } from '@stencil/core/internal/client/index' ;
68
79const globalScript = ( ) => {
810 setMode ( ( elm ) => {
911 return ( elm as any ) . colormode || elm . getAttribute ( 'colormode' ) ;
1012 } ) ;
1113} ;
1214
15+ // this doesn't do anything - just stops rollup removing the import
16+ setAssetPath ( '/base/path' ) ;
17+
1318export default globalScript ;
You can’t perform that action at this time.
0 commit comments