Replies: 1 comment
-
i meet the same error Unknown file extension ".ts". |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure if this is the right place for this question, but I'm desperate now. 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