diff --git a/packages/@tailwindcss-upgrade/src/index.ts b/packages/@tailwindcss-upgrade/src/index.ts index 945b48ab42d9..3d8746e3cfb6 100644 --- a/packages/@tailwindcss-upgrade/src/index.ts +++ b/packages/@tailwindcss-upgrade/src/index.ts @@ -78,16 +78,16 @@ async function run() { // Discover CSS files in case no files were provided if (files.length === 0) { - info('Searching for CSS files in the current directory and its subdirectories…') + info('Searching for CSS or SCSS files in the current directory and its subdirectories…') - files = await globby(['**/*.css'], { + files = await globby(['**/*.{css,scss}'], { absolute: true, gitignore: true, }) } - // Ensure we are only dealing with CSS files - files = files.filter((file) => file.endsWith('.css')) + // Ensure we are only dealing with CSS and SCSS files + files = files.filter((file) => file.endsWith('.css' || '.scss')) // Analyze the stylesheets let loadResults = await Promise.allSettled(files.map((filepath) => Stylesheet.load(filepath))) diff --git a/packages/@tailwindcss-upgrade/src/utils/resolve.ts b/packages/@tailwindcss-upgrade/src/utils/resolve.ts index 58f5834ba0c0..29067575ab9e 100644 --- a/packages/@tailwindcss-upgrade/src/utils/resolve.ts +++ b/packages/@tailwindcss-upgrade/src/utils/resolve.ts @@ -38,7 +38,7 @@ export function resolveJsId(id: string, base: string) { const resolver = EnhancedResolve.ResolverFactory.createResolver({ fileSystem: new EnhancedResolve.CachedInputFileSystem(fs, 4000), useSyncFileSystemCalls: true, - extensions: ['.css'], + extensions: ['.css', '.scss'], mainFields: ['style'], conditionNames: ['style'], })