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-plugin-angular): update plugin to ignore tsx files #102

Merged
merged 1 commit into from
Oct 12, 2022
Merged

fix(vite-plugin-angular): update plugin to ignore tsx files #102

merged 1 commit into from
Oct 12, 2022

Conversation

himyjan
Copy link
Contributor

@himyjan himyjan commented Oct 11, 2022

change line 125 176 from tsx to ts, set plugin not try to compile tsx file. #100 (comment)

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • vite-angular-plugin
  • astro-angular
  • create-analog

What is the current behavior?

Issue Number: #100

What is the new behavior?

1.fix #100 only comple .ts file

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@himyjan himyjan changed the title fix #100 plug compile tsx error fix(vite-plugin-angular): issue #100 plug compile tsx error Oct 11, 2022
@himyjan himyjan changed the title fix(vite-plugin-angular): issue #100 plug compile tsx error fix(vite-plugin-angular): issue #100 compile tsx error Oct 11, 2022
@brandonroberts
Copy link
Member

Thanks @himyjan. Let's keep this PR focused on fixing the bug. The package.json and other updates should be in a separate PR.

@himyjan himyjan closed this Oct 11, 2022
@himyjan himyjan reopened this Oct 11, 2022
@@ -122,7 +122,7 @@ export function angular(options?: PluginOptions): Plugin[] {
await buildAndAnalyze();
},
async handleHotUpdate(ctx) {
if (/\.[cm]?tsx?$/.test(ctx.file)) {
if (/\.[cm]?ts?$/.test(ctx.file)) {
Copy link
Member

Choose a reason for hiding this comment

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

Remove the question mark also

Suggested change
if (/\.[cm]?ts?$/.test(ctx.file)) {
if (/\.[cm]?ts$/.test(ctx.file)) {

@@ -173,7 +173,7 @@ export function angular(options?: PluginOptions): Plugin[] {
return;
}

if (/\.[cm]?tsx?$/.test(id)) {
if (/\.[cm]?ts?$/.test(id)) {
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Suggested change
if (/\.[cm]?ts?$/.test(id)) {
if (/\.[cm]?ts$/.test(id)) {

change line 125 176 from tsx to ts, set plugin not try to compile tsx file.
#100 (comment)

Update angular-vite-plugin.ts
@brandonroberts brandonroberts changed the title fix(vite-plugin-angular): issue #100 compile tsx error fix(vite-plugin-angular): update plugin to ignore tsx files Oct 11, 2022
@brandonroberts brandonroberts merged commit 8bf9854 into analogjs:main Oct 12, 2022
@brandonroberts
Copy link
Member

Thanks @himyjan! @allcontributors add @himyjan for code

@allcontributors
Copy link
Contributor

@brandonroberts

I've put up a pull request to add @himyjan! 🎉

Villanuevand pushed a commit to Villanuevand/analog that referenced this pull request Sep 12, 2023
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.

bug: Vite Plugin tries to compile tsx files for React Components
2 participants