@@ -13,7 +13,7 @@ export default function getIntro ( format, options, imports ) {
13
13
14
14
function getAmdIntro ( options , imports ) {
15
15
const sourceString = imports . length ?
16
- `[ ${ imports . map ( declaration => `'${ declaration . source . value } '` ) . join ( ', ' ) } ], ` :
16
+ `[ ${ imports . map ( declaration => `'${ removeExtension ( declaration . source . value ) } '` ) . join ( ', ' ) } ], ` :
17
17
'' ;
18
18
19
19
const id = options . amd && options . amd . id ;
@@ -48,7 +48,7 @@ function getUmdIntro ( options, imports ) {
48
48
49
49
const amdId = options . amd && options . amd . id ? `'${ options . amd . id } ', ` : '' ;
50
50
51
- const amdDeps = imports . length ? `[${ imports . map ( declaration => `'${ declaration . source . value } '` ) . join ( ', ' ) } ], ` : '' ;
51
+ const amdDeps = imports . length ? `[${ imports . map ( declaration => `'${ removeExtension ( declaration . source . value ) } '` ) . join ( ', ' ) } ], ` : '' ;
52
52
const cjsDeps = imports . map ( declaration => `require('${ declaration . source . value } ')` ) . join ( ', ' ) ;
53
53
const globalDeps = getGlobals ( imports , options ) ;
54
54
@@ -63,3 +63,8 @@ function getUmdIntro ( options, imports ) {
63
63
function paramString ( imports ) {
64
64
return imports . length ? ` ${ imports . map ( dep => dep . name ) . join ( ', ' ) } ` : '' ;
65
65
}
66
+
67
+ function removeExtension ( file ) {
68
+ const index = file . lastIndexOf ( '.' ) ;
69
+ return ~ index ? file . slice ( 0 , index ) : file ;
70
+ }
0 commit comments