Writing JavaScript without a build system
1–10 of 187 posts
Re: Writing JavaScript without a build system
#2Me too. And the tips already in here are pretty good!
Re: Writing JavaScript without a build system
#3Import maps are also worth exploring. Documentation isn't great but I've managed to ditch npm on some side projects and use import maps and CDNs instead. Worth it for small projects without a doubt.
Re: Writing JavaScript without a build system
#4 {
"compilerOptions": {
"checkJs": true,
"target": "es2020"
}
}Re: Writing JavaScript without a build system
#5Try to use as few dependencies as possible.
You don't need a framework--components are achievable without vue and react etc.
Server side rendering and VDom are really not needed for most projects.
Think of Programming in JavaScript, CSS and F5 rather than Typescript and SASS as the equivalent of Marcus Aurelius' Stoicism.
Re: Writing JavaScript without a build system
#6Re: Writing JavaScript without a build system
#7You can have something like a `lib` directory in your project and place submodules for other projects in there. The dependencies need to provide some sort of a prebuilt artifact in the repo that you can import (or natively support ES Modules), but I've had good luck so far.
I'll also shout out jsdelivr[1] which is great for pulling dependencies directly from github.
Re: Writing JavaScript without a build system
#8Use npm to install libraries one time only. Try to use as few dependencies as possible. You don't need a framework--components are achievable without vue and react etc. Server side rendering and VDom are really not needed for most projects. Think of Programming in JavaScript, CSS and F5 rather than Typescript and SASS as the equivalent of Marcus Aurelius' Stoicism.
Re: Writing JavaScript without a build system
#9All those extraneous elements to Javascript are a real turn-off. Python: batteries mostly included. Javascript: feels like you need to drag a dozen suitcases along anytime you embark on any non-trivial project.
Re: Writing JavaScript without a build system
#101. MDN has a comprehensive guide on JavaScript modules [0]
2. A build system free way to build interactive websites could be to combine libraries like htmx[1] and or lit[2] or just the sub package lit-html[3]. Or just go with native web components and a bit of AJAX.
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...
[1] https://github.com/bigskysoftware/htmx