@@ -22,6 +22,7 @@ import { isRepoDirty } from './utils/git'
22
22
import { hoistStaticGlobParts } from './utils/hoist-static-glob-parts'
23
23
import { pkg } from './utils/packages'
24
24
import { eprintln , error , header , highlight , info , relative , success } from './utils/renderer'
25
+ import * as version from './utils/version'
25
26
26
27
const options = {
27
28
'--config' : { type : 'string' , description : 'Path to the configuration file' , alias : '-c' } ,
@@ -98,14 +99,17 @@ async function run() {
98
99
error ( `${ e ?. message ?? e } ` , { prefix : '↳ ' } )
99
100
}
100
101
101
- // Ensure stylesheets are linked to configs
102
- try {
103
- await linkConfigsToStylesheets ( stylesheets , {
104
- configPath : flags [ '--config' ] ,
105
- base,
106
- } )
107
- } catch ( e : any ) {
108
- error ( `${ e ?. message ?? e } ` , { prefix : '↳ ' } )
102
+ // Ensure stylesheets are linked to configs. But this is only necessary when
103
+ // migrating from v3 to v4.
104
+ if ( version . isMajor ( 3 ) ) {
105
+ try {
106
+ await linkConfigsToStylesheets ( stylesheets , {
107
+ configPath : flags [ '--config' ] ,
108
+ base,
109
+ } )
110
+ } catch ( e : any ) {
111
+ error ( `${ e ?. message ?? e } ` , { prefix : '↳ ' } )
112
+ }
109
113
}
110
114
111
115
// Migrate js config files, linked to stylesheets
0 commit comments