@@ -7,7 +7,6 @@ import { PluginContext, rollup, RollupOptions, TreeshakingOptions } from 'rollup
7
7
8
8
import type * as d from '../../declarations' ;
9
9
import { lazyComponentPlugin } from '../output-targets/dist-lazy/lazy-component-plugin' ;
10
- import { createCustomResolverAsync } from '../sys/resolve/resolve-module-async' ;
11
10
import { appDataPlugin } from './app-data-plugin' ;
12
11
import type { BundleOptions } from './bundle-interface' ;
13
12
import { coreResolvePlugin } from './core-resolve-plugin' ;
@@ -58,25 +57,24 @@ export const getRollupOptions = (
58
57
buildCtx : d . BuildCtx ,
59
58
bundleOpts : BundleOptions ,
60
59
) : RollupOptions => {
61
- const customResolveOptions = createCustomResolverAsync ( config . sys , compilerCtx . fs , [
62
- '.tsx' ,
63
- '.ts' ,
64
- '.js' ,
65
- '.mjs' ,
66
- '.json' ,
67
- '.d.ts' ,
68
- ] ) ;
69
60
const nodeResolvePlugin = rollupNodeResolvePlugin ( {
70
61
mainFields : [ 'collection:main' , 'jsnext:main' , 'es2017' , 'es2015' , 'module' , 'main' ] ,
71
- customResolveOptions,
72
62
browser : true ,
73
63
rootDir : config . rootDir ,
74
64
...( config . nodeResolve as any ) ,
65
+ extensions : [ '.tsx' , '.ts' , '.js' , '.mjs' , '.json' , '.d.ts' ] ,
75
66
} ) ;
76
67
77
- const orgNodeResolveId = nodeResolvePlugin . resolveId ;
78
- const orgNodeResolveId2 = ( nodeResolvePlugin . resolveId = async function ( importee : string , importer : string ) {
68
+ // @ts -expect-error - this is required now.
69
+ nodeResolvePlugin . resolve = async function ( ) {
70
+ // Investigate if we can use this to leverage Stencil's in-memory fs
71
+ } ;
72
+ // @ts -expect-error - handler is defined
73
+ const orgNodeResolveId = nodeResolvePlugin . resolveId . handler ;
74
+ // @ts -expect-error - handler is defined
75
+ const orgNodeResolveId2 = ( nodeResolvePlugin . resolveId . handler = async function ( importee : string , importer : string ) {
79
76
const [ realImportee , query ] = importee . split ( '?' ) ;
77
+ // @ts -ignore
80
78
const resolved = await orgNodeResolveId . call (
81
79
nodeResolvePlugin as unknown as PluginContext ,
82
80
realImportee ,
0 commit comments