Skip to content

How to import utility module in a vite project #160

Discussion options

You must be logged in to vote

Thanks @webJose for the quick reply 🙇

Understood how externals work in Vite and, as you suggested, implemented vite-plugin-externalize-dependencies to suppress the dependency errors.

The main thing is, if all the configurations are done correctly, things are working perfectly but since Vite does not recognise external dependencies in runtime (npm run dev) the App won't come up due to that error. Hence, suppressing the error makes it work!!


Here's what I did

I added vite-plugin-externalize-dependencies in my project. So, my vite.config.js (for the MiFe where I want to add the utility) looks like this now

vite.config.js

import { defineConfig } from 'vite'
import react from '@vitejs/plugi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Khodidas-withLoveKD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants