@@ -12,7 +12,6 @@ const commands = {
12
12
'dev' : 'Start the app in development mode' ,
13
13
'start' : 'Start the app in production mode' ,
14
14
'build' : 'Build the app to a static site (SSG)' ,
15
- 'analyze' : 'Analyze the app deps' ,
16
15
'upgrade' : 'Upgrade Aleph.js command'
17
16
}
18
17
@@ -98,19 +97,21 @@ async function main() {
98
97
const importMap = await loadImportMap ( importMapFile )
99
98
let updateImportMaps : boolean | null = null
100
99
let verison = VERSION
101
- for ( const key in importMap . imports ) {
102
- const url = importMap . imports [ key ]
103
- if ( / \/ \/ d e n o \. l a n d \/ x \/ a l e p h @ v ? \d + \. \d + \. \d + ( - [ a - z 0 - 9 \. ] + ) ? \/ / . test ( url ) ) {
104
- const [ prefix , rest ] = util . splitBy ( url , '@' )
105
- const [ ver , suffix ] = util . splitBy ( rest , '/' )
106
- if ( ver !== 'v' + VERSION && updateImportMaps === null ) {
107
- updateImportMaps = confirm ( `You are using a different version of Aleph.js, expect ${ ver } -> v${ bold ( VERSION ) } , update '${ basename ( importMapFile ) } '?` )
108
- if ( ! updateImportMaps ) {
109
- verison = ver . slice ( 1 )
100
+ if ( command === 'dev' ) {
101
+ for ( const key in importMap . imports ) {
102
+ const url = importMap . imports [ key ]
103
+ if ( / \/ \/ d e n o \. l a n d \/ x \/ a l e p h @ v ? \d + \. \d + \. \d + ( - [ a - z 0 - 9 \. ] + ) ? \/ / . test ( url ) ) {
104
+ const [ prefix , rest ] = util . splitBy ( url , '@' )
105
+ const [ ver , suffix ] = util . splitBy ( rest , '/' )
106
+ if ( ver !== 'v' + VERSION && updateImportMaps === null ) {
107
+ updateImportMaps = confirm ( `You are using a different version of Aleph.js, expect ${ ver } -> v${ bold ( VERSION ) } , update '${ basename ( importMapFile ) } '?` )
108
+ if ( ! updateImportMaps ) {
109
+ verison = ver . slice ( 1 )
110
+ }
111
+ }
112
+ if ( updateImportMaps ) {
113
+ importMap . imports [ key ] = `${ prefix } @v${ VERSION } /${ suffix } `
110
114
}
111
- }
112
- if ( updateImportMaps ) {
113
- importMap . imports [ key ] = `${ prefix } @v${ VERSION } /${ suffix } `
114
115
}
115
116
}
116
117
}
0 commit comments