Mobilen First Approach using TailwindCSS and JavaScript
Design comparison
Solution retrospective
Hi everyone,
This is my solution to the calculator app challenge. I learned alot of things while doing it. Hope you enjoy it.
Quick question though, how do you guys include one javascript file into another file? for example you have first.js and second.js files and you want to include both in main.js file, whats the trick?
Community feedback
- @asbhogalPosted over 1 year ago
Hi Ibrahim,
Great work! In answer to your question, you export your functions and then import these as modules into another file (whether that's a second, or a main one.) This takes advantage of ES6, and conventionally you use a bundler to handle this, as vanilla environments can't handle module compilation without it. The easiest one to use in this case is Vite, which supports vanilla (pure HTML, CSS and JS) files, React, Angular etc. If you deploy these to Vercel, the platform will re-build your project with each Git commit. If you're new to these practices, I'd be happy to send you some links to documentation etc.
Hope this helps!
Marked as helpful0@ibrahimherithPosted over 1 year agoHello aman,
Thanks for taking your time to answer my question. Your suggestions were helpful, but i am new to some of the practices that you mentioned. i'd be thankful if you send me some of links to documentation so as i can get more insights to the subject.
Regards.
0@asbhogalPosted over 1 year ago@ibrahimherith No problem Ibrahim. Here's some links which will hopefully help:
Once you have your project ready, you can sign up to Vercel using your GitHub account and then select the project to deploy. Vercel takes care of the bulk of the work (at this point you won't need to worry about additional config.) Additional Info
Note that the last two will require having Node.js on your system. If you don't have it installed, here's a guide (this will work for both Mac and Windows) Link
Hope this helps
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord