Skip to content

Add .scss files to upgrade script. #16285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/@tailwindcss-upgrade/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-upgrade/src/utils/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
})
Expand Down