@@ -22,6 +22,7 @@ import { isRepoDirty } from './utils/git'
2222import { hoistStaticGlobParts } from './utils/hoist-static-glob-parts'
2323import { pkg } from './utils/packages'
2424import { eprintln , error , header , highlight , info , relative , success } from './utils/renderer'
25+ import * as version from './utils/version'
2526
2627const options = {
2728 '--config' : { type : 'string' , description : 'Path to the configuration file' , alias : '-c' } ,
@@ -98,14 +99,17 @@ async function run() {
9899 error ( `${ e ?. message ?? e } ` , { prefix : '↳ ' } )
99100 }
100101
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+ }
109113 }
110114
111115 // Migrate js config files, linked to stylesheets
0 commit comments