Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Didn't check tbh, I used it once on a production project and most of the time on side projects due to this "zero config"; actually it has a couple of quirks that need to be understood though. At the point we choose parcel, the output was definitely lower in weight than webpack, but I didn't tested it against rollup.
The setup speed is quite good and it handles config and deps whenever it found them in the project.
Quick example. If your entry point look like that:
and you want to add a global scss, you can simply do:
<linkrel="stylesheet"href="./styles/main.scss">
and Parcel will install some scss-to-css parser as dependency, also optimize it with cssnano or any other optimizer and build the entire thing, replace the reference to the scss file in the html for a reference to the parsed, minified, optimized and hashed css version and serve it for you.
Isn't automation the absolute end target in our field? ๐๐
I tested parcel as you've suggested, here's what I've got:
npm i parcel --save-dev
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
added 166 packages, and audited 167 packages in 23s
72 packages are looking for funding
run `npm fund`for details
found 0 vulnerabilities
166 packages, twice that of vite, but also no vulnerabilities.
Takes a lot more space on the disc though:
du-hc-s node_modules
204M node_modules
It seems to be quite slow, to be honest:
./node_modules/.bin/parcel public/index.html
Server running at http://localhost:1234
โจ Built in 976ms
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
It's slower the first time always (or when you add new things that require new deps) as it needs to check your project thingies to install other dependencies, it should be faster in subsequent builds, also the top benefit is on config (or the lack of it)
I am finding very versatile to create bundle js and css files that code be used without npm, just include them 8n app layout is vite do the same? Personally I prefer to use gulp for this, if you would like to see an example, i'll paste here link to one of a github project
While vite or the underlying rollup would do what you described, esbuild, as described in the end of the article, might be a better option. It can be used as an executable or via JavaScript or Go API.
Vite can be help to remove vulnerability from legacy project which contains react 15 - 16 - 17 modules to upgrade react 18?
My node_modules around 1Gb.
Vite doesn't remove vulnerabilities. It has less dependencies of its own, so replacing tooling of a legacy project with vite will help, but only to a certain extent.
Unfortunately, refactoring an old project is a tedious and manual task.
We're a place where coders share, stay up-to-date and grow their careers.
You can also use Parcel bundler which is quite convenient most of the time
Didn't you tried it before?
Yes, I believe I did, though don't recall much. How does it fair in comparison to the tools from the article?
Didn't check tbh, I used it once on a production project and most of the time on side projects due to this "zero config"; actually it has a couple of quirks that need to be understood though. At the point we choose parcel, the output was definitely lower in weight than webpack, but I didn't tested it against rollup.
The setup speed is quite good and it handles config and deps whenever it found them in the project.
Quick example. If your entry point look like that:
and you want to add a global scss, you can simply do:
and Parcel will install some scss-to-css parser as dependency, also optimize it with cssnano or any other optimizer and build the entire thing, replace the reference to the scss file in the html for a reference to the parsed, minified, optimized and hashed css version and serve it for you.
Isn't automation the absolute end target in our field? ๐๐
I tested parcel as you've suggested, here's what I've got:
166 packages, twice that of vite, but also no vulnerabilities.
Takes a lot more space on the disc though:
It seems to be quite slow, to be honest:
Thanks for the info! ๐
It's slower the first time always (or when you add new things that require new deps) as it needs to check your project thingies to install other dependencies, it should be faster in subsequent builds, also the top benefit is on config (or the lack of it)
I replaced CRA with Vite long time ago never looked back.
yep, CRA is sucks
I like this article.
Tools are evolving and we need to switch gears to other tools like vite or nextjs to solve some moder problems
I tried Vite recently and then no more CRA =))
Sure, In my recent project CRA gave me 72 vulnerabilities
Thanks for the post, it is very interesting!
I am finding very versatile to create bundle js and css files that code be used without npm, just include them 8n app layout is vite do the same? Personally I prefer to use gulp for this, if you would like to see an example, i'll paste here link to one of a github project
While vite or the underlying rollup would do what you described, esbuild, as described in the end of the article, might be a better option. It can be used as an executable or via JavaScript or Go API.
Thanks for replying and interesting article
Vite can be help to remove vulnerability from legacy project which contains react 15 - 16 - 17 modules to upgrade react 18?
My node_modules around 1Gb.
Vite doesn't remove vulnerabilities. It has less dependencies of its own, so replacing tooling of a legacy project with vite will help, but only to a certain extent.
Unfortunately, refactoring an old project is a tedious and manual task.