Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ginolica's avatar

Vite Config not type="module" but type="text/javascript"

I.m new to Vite. Before I used Grunt now I got some issues, with some helper functions.

I can't reach theme anymore.

The script tag is with module like this

type="module"

What I want is

type="text/javascript"

Is there a way to set this in the config, or does some one knows an other solution?

Thanks in advanced

0 likes
2 replies
Sinnbeck's avatar

That's how vite works. As far as I know you cannot opt out of that. Why do you need to?

Ginolica's avatar

@Sinnbeck

Tanks for your response, I imported multiple files in to my app.js but the don't communicate anymore. In Grunt i concatenate all files in to one and I could call an helper function in every file now I can't, and when I build. Vite outputs all files separately. Not as one file. Maybe I don't understand Vite yet.

Do I import all files in app.js or is there an other way to concat multiple files in to one?

Please or to participate in this conversation.