File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ export default function optionsSanitiser(input: RegistryOptions): Config {
164164 const gzip = zlib . gzipSync ( minified , { level : 7 } ) ;
165165 options . compiledClient = {
166166 ...compiled ,
167+ imports : clientOptions . imports ,
167168 code : {
168169 minified,
169170 gzip,
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ function componentPreview(
3434 previewView ( {
3535 robots : res . conf . discovery . robots ,
3636 component,
37- importmap : getOcConfig ( res . conf . path ) ?. development ?. importmap ,
37+ imports :
38+ getOcConfig ( res . conf . path ) ?. development ?. importmap ?. imports ||
39+ res . conf . compiledClient ?. imports ,
3840 fallbackClient : res . conf . fallbackClient
3941 ? `${ res . conf . fallbackRegistryUrl . replace ( / \/ $ / , '' ) } /oc-client/client.dev.js`
4042 : undefined ,
Original file line number Diff line number Diff line change @@ -8,14 +8,12 @@ export default function preview(vm: {
88 liveReload : string ;
99 templates : TemplateInfo [ ] ;
1010 robots : boolean ;
11- importmap ?: {
12- imports ?: Record < string , string > ;
13- } ;
11+ imports ?: Record < string , string > ;
1412 preload ?: string ;
1513} ) : string {
1614 const baseUrl = vm . href . replace ( 'http://' , '//' ) . replace ( 'https://' , '//' ) ;
1715 const { name, version } = vm . component ;
18- const imports = vm . importmap ?. imports || vm . component . oc . files . imports ;
16+ const imports = vm . imports || vm . component . oc . files . imports ;
1917 const componentHref = `${ baseUrl } ${ name } /${ version } /${ vm . qs } ` ;
2018 const clientHref = vm . fallbackClient || `${ baseUrl } oc-client/client.js` ;
2119 const id = `oc-${ name } @${ version } ` ;
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export interface Config<T = any> {
174174 * @internal
175175 */
176176 compiledClient ?: {
177+ imports ?: Record < string , string > ;
177178 code : { gzip : Buffer ; brotli : Buffer ; minified : string } ;
178179 map : string ;
179180 dev : string ;
You can’t perform that action at this time.
0 commit comments