Replies: 1 comment
-
Struggling with doing the same setup. We are running into the following error when trying to import the base config
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to make monorepo using Turborepo. I have a lot of Vue projects there and I need to share Vite config across all applications. Here's how I'm trying to achieve this.
I have package named
@monorepo/configs
:package.json:
vite.config.base.ts:
index.ts:
And in the other application's vite.config.ts:
Here I import ViteConfigBase as a file from 'src' folder and this is the error that I get after
npm run dev
:If I change import from 'src' folder to import from index, like this:
Then the error will be this:
OOokkay, I've seen it before. Let's try "type": "module" in package.json. Now that's the error:
And this is where I'm stuck. I need those files to be .ts for sure (and I'm not sure if they would work if I change extention to .js).
I could also easily fix this by just adding the build step, but I don't think it is that necessary and there should be the way around. The build step will add a lot of overhead to development process and the code itself. I've tried it and the
dist
folder was around ~4Mb for no reason. Also, I won't be able to use "Go to definition" feature in this case, and last but not least, it has to be rebuilt after every change, so I really wish to avoud this step and just use raw config files everywhere.Beta Was this translation helpful? Give feedback.
All reactions