File tree 1 file changed +24
-8
lines changed
1 file changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,18 @@ export let createInterfaceFileUsingValidBscExePath = (
252
252
}
253
253
} ;
254
254
255
+ let getCompiledFolderName = ( moduleFormat : string ) : string => {
256
+ switch ( moduleFormat ) {
257
+ case "es6" :
258
+ return "es6" ;
259
+ case "es6-global" :
260
+ return "es6_global" ;
261
+ case "commonjs" :
262
+ default :
263
+ return "js" ;
264
+ }
265
+ } ;
266
+
255
267
export let getCompiledFilePath = (
256
268
filePath : string ,
257
269
projDir : string
@@ -272,13 +284,17 @@ export let getCompiledFilePath = (
272
284
let module = c . bsconfigModuleDefault ;
273
285
let suffix = c . bsconfigSuffixDefault ;
274
286
275
- if ( pkgSpecs && pkgSpecs . module ) {
276
- moduleFormatObj = pkgSpecs ;
277
- } else if ( pkgSpecs && pkgSpecs [ 0 ] ) {
278
- if ( typeof pkgSpecs [ 0 ] === "string" ) {
279
- module = pkgSpecs [ 0 ] ;
280
- } else {
281
- moduleFormatObj = pkgSpecs [ 0 ] ;
287
+ if ( pkgSpecs ) {
288
+ if ( pkgSpecs . module ) {
289
+ moduleFormatObj = pkgSpecs ;
290
+ } else if ( typeof pkgSpecs === "string" ) {
291
+ module = pkgSpecs ;
292
+ } else if ( pkgSpecs [ 0 ] ) {
293
+ if ( typeof pkgSpecs [ 0 ] === "string" ) {
294
+ module = pkgSpecs [ 0 ] ;
295
+ } else {
296
+ moduleFormatObj = pkgSpecs [ 0 ] ;
297
+ }
282
298
}
283
299
}
284
300
@@ -287,7 +303,7 @@ export let getCompiledFilePath = (
287
303
}
288
304
289
305
if ( ! moduleFormatObj [ "in-source" ] ) {
290
- pathFragment = "lib/" + module . replace ( "-" , "_" ) ;
306
+ pathFragment = "lib/" + getCompiledFolderName ( module ) ;
291
307
}
292
308
293
309
if ( moduleFormatObj . suffix ) {
You can’t perform that action at this time.
0 commit comments