Skip to content
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

Fix Vite dependency extract #3219

Merged
merged 2 commits into from
Feb 5, 2025
Merged

Fix Vite dependency extract #3219

merged 2 commits into from
Feb 5, 2025

Conversation

palicko
Copy link
Contributor

@palicko palicko commented Feb 4, 2025

Hey,
first of all, great job implementing Vite to the Sage, I love it!

Dependency extraction regex is working fine when imports are defined in single line, but not working when imports are defined using new lines, e.g.

import {
  InnerBlocks,
  InspectorControls,
  RichText,
  useBlockProps,
  useInnerBlocksProps,
} from '@wordpress/block-editor';

This PR should fix regex and add check if extracted import is not empty (last comma in import block was causing trouble).

Also I've added small fix for Typescript compatibility.

Copy link
Member

@retlehs retlehs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@retlehs retlehs merged commit 6012bf1 into roots:main Feb 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants