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

@quasar-vite-plugin, when importing dependencies that wrap quasar components, it cannot handle quasar imports containing special characters #17954

Open
liuenzuo666 opened this issue Apr 5, 2025 · 0 comments
Labels
area/plugins bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@liuenzuo666
Copy link

What happened?

I used quasar to package my own component library for unified style, but two copies of quasar code appeared after packaging because the import quasar of my component library was not processed correctly. The production mode package used the quasar-client.js file, for example, import { QBtn as $ } from "Quasar", $ was not processed correctly by the regular expression

What did you expect to happen?

perfecting regular expressions

Reproduction URL

https://github.com/quasarframework/quasar/blob/dev/vite-plugin/src/js-transform.js

How to reproduce?

const importQuasarRegex = /import\s*{([\w,\s]+)}\sfrom\s(['"])quasar\2;?/g;

code = import { QBtn as $B } from "quasar";;

code2 = import { QBtn } from "quasar";

code.replace(importQuasarRegex, (, match) => console.log(code, match));
code2.replace(importQuasarRegex, (
, match) => console.log(code2, match));

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Plugins (quasar)

Platforms/Browsers

No response

Quasar info output

Relevant log output

Additional context

No response

@github-actions github-actions bot added area/plugins bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

1 participant