#Tauri + Vanilla JS + import?
12 messages · Page 1 of 1 (latest)
That's because you need a bundler of some kind to use that syntax
Like Vite, Webpack or Rollup
Oh thank u Simon. My simple cause was just trying to include a .js file inside another .js file. Without adding any bundler additionally, the simplest way for me is to include both .js files in <script> tag in html?
Both yes and no. As your project grows that'll start to create really, really poorly performing pages since you add so many scripts to load. It'd be better then to load scripts dynamically by adding script tags when the relevant code is needed
I strongly urge you to start looking at using a framework instead of using vanilla js, because in a couple months you'll discover that what you've been doing is developing your own mini framework
That is correct, been in this situation before. Thanks, will switch to a framework.
One last thing. Webpack seems quite fine and minimal, is this what I need to add? npm install @tauri-apps/tauri-webpack?
There's a tauri-webpack package?
Ah, it's 4 years old
Almost as old as the project itself lol
hehe
I would urge you to use Vite instead because Webpack is the larger of them