Vite and relative paths #16062
Unanswered
labs20
asked this question in
CLI - PWA mode
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I'm trying to migrate to Vite and I'm facing some challenges with relative paths.
I have a project file structure that have a folder that is a common server "resolver", multiple folders each one being a quasar client for different projects, and a global mixin folder that share logic among the different clients, like this:
All pages in my apps import
page.js
as a component.page.js
importscomp_a, _b and _c.js
as components. All imports are relative, so a page will importpage.js
like thisimport Page from "../../../../mixins/page";
and insidepage.js
imports will be likeimport CompA from "./comps/comp_a";
.This works very well with no problems with webpack.
To get started with Vite, I had to create an alias on quasar.config to mixins folder, and after that, my pages can find
import Page from "mixins/page"
, but page.js is not resolving the relative./comps
and so breaking with errorFailed to resolve import "./comps ...
.How can I solve this? Any tips?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions