TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Parcel – Fast, zero-configuration web application bundler

347 pointsby giladover 5 years ago

37 comments

vecinuover 5 years ago
It should be noted that Parcel was created in house at Adobe and then open sourced.<p>I think it&#x27;s always nice to call out the contributions certain corps are making to the OSS world.
评论 #21964271 未加载
评论 #21964435 未加载
zelphirkaltover 5 years ago
Except, that it is not really zero configuration and you still have to figure out some settings for getting source maps to be referenced correctly.<p>It is blazing fast though and much less a pain to set up than webpack. Every time I have to touch webpack configurations I think: &quot;Oh no, not that stuff again ...&quot; and it will take time to get it exactly the way I want or even requires to load additional helper modules from NPM. Ugh.
评论 #21962765 未加载
评论 #21964738 未加载
评论 #21962601 未加载
jchwover 5 years ago
Parcel Bundler is really fun. I would implore people to try it before jumping into too much cynicism because their pursuit for zero configuration has lead to some genius design decisions.<p>One constant problem with bundlers is how to rewrite the HTML files to match the JS&#x2F;CSS bundles. You can do all kinds of crap including scripts with regexes, plugins, etc. but what if you could do better?<p>Put simply, Parcel does better. HTML files themselves can be entries, and they will be compiled such that all of the stylesheets and scripts are compiled, bundled and linked to the HTML file in the output. Now you don’t need to worry about mucking with writing the hash into your HTML.<p>Parcel isn’t perfect but it makes a great static site gen. Its plugin interface can be slightly cumbersome, but it’s flexible enough that you can abuse it pretty effectively. As an example, I used Parcel to generate some documentation built off of Kaitai Struct KSY files, which are effectively YAML files. I push the KSY data through an HTML template that generates the doc page. It was a lot of fun. You can see it here:<p><a href="https:&#x2F;&#x2F;packets.pangdox.com&#x2F;packets&#x2F;loginservice&#x2F;server&#x2F;0002.html" rel="nofollow">https:&#x2F;&#x2F;packets.pangdox.com&#x2F;packets&#x2F;loginservice&#x2F;server&#x2F;0002...</a>
评论 #21964217 未加载
macawfishover 5 years ago
One cool thing about parcel is that you can use es import syntax to &quot;import&quot; stuff from rust modules. It will then automagically do all the wasm interfacing for you during the bundling process. Wow!<p>You can also import stuff from wasm modules too of course, but I like the magic of &quot;importing rust into JavaScript&quot;. It seems like a great way for someone like me, who wants to learn, to use rust into a simple web project without worrying too hard about wasm.<p><a href="https:&#x2F;&#x2F;parceljs.org&#x2F;rust.html" rel="nofollow">https:&#x2F;&#x2F;parceljs.org&#x2F;rust.html</a>
评论 #21963156 未加载
k_bxover 5 years ago
If 9 seconds is &quot;Blazing fast&quot;, I wonder how would something like Elm experience of usually building stuff in around 0.2s be named. I think 9s is an embarrassing number, especially when you mostly compile JS to JS.
评论 #21967756 未加载
frankpfover 5 years ago
Parcel is great, but I would avoid using it again due to the sheer number of dependencies (730 packages!)[1]. Webpack has the same problem[2], depending on 342 packages. Rollup is the best one on this regard, depending only on 3 packages.<p>[1]: <a href="http:&#x2F;&#x2F;npm.anvaka.com&#x2F;#&#x2F;view&#x2F;2d&#x2F;parcel" rel="nofollow">http:&#x2F;&#x2F;npm.anvaka.com&#x2F;#&#x2F;view&#x2F;2d&#x2F;parcel</a><p>[2]: <a href="http:&#x2F;&#x2F;npm.anvaka.com&#x2F;#&#x2F;view&#x2F;2d&#x2F;webpack" rel="nofollow">http:&#x2F;&#x2F;npm.anvaka.com&#x2F;#&#x2F;view&#x2F;2d&#x2F;webpack</a>
评论 #21962743 未加载
评论 #21962641 未加载
评论 #21963950 未加载
评论 #21965851 未加载
评论 #21964550 未加载
评论 #21962609 未加载
评论 #21962870 未加载
choxiover 5 years ago
Parcel is great, 99% of the time I&#x27;m doing frontend development I just want my build tool to convert Sass&#x2F;Less&#x2F;JSX&#x2F;Babel code to whatever browsers support. It&#x27;s nice to just source a .sass or .js file and have Parcel figure out the rest.<p>Has anyone used Parcel and Webpack and still prefers Webpack?
评论 #21963620 未加载
评论 #21962362 未加载
评论 #21962509 未加载
评论 #21962383 未加载
评论 #21963198 未加载
评论 #21962815 未加载
joshwaover 5 years ago
Ah, the classic build tool evolution cycle!<p>1. Become frustrated with complex build tool<p>2. Write a new tool that is dead simple, opinionated (your opinions), convention over configuration, etc<p>3. Post to HN<p>4. Achieve adoption<p>5. As more people use the tool, feature creep ensues<p>6. In order to satisfy diverse use cases, make everything modular and configurable!<p>7. Tool slows and becomes impossible to manage<p>8. GOTO 1.
评论 #21963258 未加载
评论 #21963354 未加载
评论 #21963496 未加载
评论 #21963343 未加载
评论 #21963202 未加载
评论 #21963662 未加载
评论 #21963322 未加载
krestenover 5 years ago
I met a software engineer once and said “what do you do on your team?”<p>He said “I’m the webpack developer”.
评论 #21964928 未加载
评论 #21963207 未加载
评论 #21964313 未加载
评论 #21963204 未加载
eatonphilover 5 years ago
After testing it out on some personal projects, I switched a two year old core project at work from Webpack to Parcel. It took about 5 hours to get it right. The trickiest parts were finding the right alias mappings between TypeScript, our use of `~&#x2F;` paths, and importing SASS files in TypeScript. This took about an hour. The next 4 hours were figuring out how to map the changes to eslint without Webpack.<p>It is much simpler to manage so far (though upgrading internal dependencies in general could be an issue over time). It compiles much faster as well. I&#x27;m not sure how the default bundle size compares to what we had with Webpack though.
spankaleeover 5 years ago
I really dislike the huge, multi-faceted build systems calling themselves bundlers.<p>An ideal bundler would take a fully working unbundled project, which is easily writable with JS modules now, and just optimize it for production delivery.<p>The unbundled working app will be easier to develop and debug. Having a working project as input, and working project as output means that you can switch bundlers and aren&#x27;t tightly coupled to it&#x27;s transforms.<p>But most bundlers don&#x27;t work this way (Rollup is the closest, and that&#x27;s why I use it). Bundlers are typically entire build systems with compilers, CSS transforms, image optimization, etc... and they happen to bundle somewhere in the build pipeline. In the worst cases it&#x27;s not possible to run the build but _not_ bundle, if you wanted to run some of the transforms.<p>This is all kinds of bad for the JS ecosystem. You can&#x27;t really tell how a module will behave because the bundler is transforming everything. Imports aren&#x27;t really imports, CSS is concatenated and magically added to the main document. Sometimes libraries publish code to npm that _only_ works with certain bundlers.<p>Web Bundles[1] is the way out of this. It&#x27;s a standard bundle format that&#x27;ll be natively understood by browsers, is unpacked before the network cache, and _only_ a bundling format. If you just want to bundle a working project, any Web Bundle tool will work.<p>[1]: <a href="https:&#x2F;&#x2F;web.dev&#x2F;web-bundles&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.dev&#x2F;web-bundles&#x2F;</a>
评论 #21963304 未加载
评论 #21963205 未加载
评论 #21963901 未加载
XCSmeover 5 years ago
Switch to Parcel from Webpack for my latest project. I was actually surprised that it just worked, I didn&#x27;t even have to write a config file (being used to Webpack this felt like I saved hours of work).
no_wizardover 5 years ago
I would like parcel much more if they just emitted ES Modules. I don’t understand the logic of having their own loader in 2020. Same complaint I have with webpack. Just target systemJS for older browsers like rollup does. Leveraging a very efficient existing well tested solution seems wiser to me than reinventing the wheel<p>I don’t understand why they don’t support that. You can really leverage smaller bundles this way (no bundler runtime for modern browsers for one). You can also leverage type=module in the browser (which parsers more efficiently by default[0]) and use the nomodule attribute for differential loading.<p>Of course this assumes browser targets, which I feel like is the main target for these tools most of the time.<p>[0] <a href="https:&#x2F;&#x2F;v8.dev&#x2F;features&#x2F;modules" rel="nofollow">https:&#x2F;&#x2F;v8.dev&#x2F;features&#x2F;modules</a>
评论 #21962715 未加载
评论 #21962722 未加载
评论 #21962310 未加载
nbrempelover 5 years ago
I’ve used this with my most recent project 30 Hour Jobs. My goal was the quickest path to launch and this was hilariously easy compared to my old webpack config!<p>I can imagine at some point you might need more customizability with a tool like webpack - or maybe this will always be sufficient?
评论 #21962151 未加载
pull_my_fingerover 5 years ago
I like parcel a lot, but one issue I&#x27;ve always had is that it watches your node_modules folder. The devs kind of pawned it off as a &quot;feature not a bug&quot;[1], but it results in tons of warnings etc related to watching too many files. I&#x27;ve since started using a symbolic link to the actual node_modules folder, but it&#x27;s still just 1 extra hurdle that would be nice to not have.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;parcel-bundler&#x2F;parcel&#x2F;issues&#x2F;1557#issuecomment-397980426" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;parcel-bundler&#x2F;parcel&#x2F;issues&#x2F;1557#issueco...</a>
评论 #21962942 未加载
评论 #21963348 未加载
评论 #21966220 未加载
ng12over 5 years ago
Has anyone used Parcel as a replacement for create-react-app? I own some tools for generating React projects in an enterprise environment and CRA (specifically react-scripts) has been a huge thorn in my side. Most of these projects are small to medium size and so they don&#x27;t really warrant custom Webpack configurations. I&#x27;d prefer something with react-script&#x27;s simplicity but without it&#x27;s absurd restrictions.
评论 #21964185 未加载
评论 #21963447 未加载
评论 #21963495 未加载
eerrtover 5 years ago
Parcel has support for React Fast Refresh!! <a href="https:&#x2F;&#x2F;github.com&#x2F;parcel-bundler&#x2F;parcel&#x2F;pull&#x2F;3654" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;parcel-bundler&#x2F;parcel&#x2F;pull&#x2F;3654</a>
FlorianRapplover 5 years ago
We use Parcel in our Microfrontend Framework Piral (<a href="https:&#x2F;&#x2F;github.com&#x2F;smapiot&#x2F;piral" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;smapiot&#x2F;piral</a>), too. Overall, this was an awesome decision. In the past we used Webpack a lot, but it just does not feel right any more.<p>I&#x27;ve also written a small article comparing different options: <a href="https:&#x2F;&#x2F;blog.bitsrc.io&#x2F;choosing-the-right-javascript-bundler-in-2020-f9b1eae0d12b" rel="nofollow">https:&#x2F;&#x2F;blog.bitsrc.io&#x2F;choosing-the-right-javascript-bundler...</a>
runarbergover 5 years ago
I’ve been moving my projects to using es modules natively (supported natively in node 13 and with `&lt;script type=&quot;module&quot;&gt;` in the browser) and it’s pretty nice. There is no compilation step needed between edit and run. And when its ready for production, rollup is plenty.<p>I feel like node getting native es modules was the last step that the platforms needed to get up to speed with the bundlers. And the state of HTML, CSS, and JavaScript is good enough to simply use it without any external helpers (until production that is).
zubiover 5 years ago
There was a period where I started seeing Webpack everywhere, being used by everyone, so I felt obliged to try it. I struggled with the concepts and configuration and eventually realized that I completely failed to figure them out. It was a heavy blow to my developer self confidence. Fortunately I recovered when I discovered Parcel shortly after. &quot;No config&quot; immediately caught me after the frustration. I&#x27;m grateful for and still use it.
hombre_fatalover 5 years ago
I love how it even supports Elm out of the box. It&#x27;s a great feeling to replace your complicated web-of-magic-incantations webpack-config.js with a simple build command that just calls `parcel`.<p>At the very least, it&#x27;s nice to default to parcel on a project and then, if needed, adopt webpack once your project matures the point of needing more fiddling.
0xcoffeeover 5 years ago
I was amazed when I could point parcel to a html file that imported a typescript file and it worked. Only downside was that I was importing the script as a module and then half of the typescript imports stopped working. Had to bundle everything as one big typescript file to work around it.<p>I think they fixed this in Parcel 2 but didn&#x27;t try yet.
Zealotuxover 5 years ago
Parcel looks promising, especially to finally free yourself from Webpack&#x27;s configuration soup, and the compilation time gain looks great. I just wish it has better TypeScript support, it looks like it&#x27;s still not possible to check types on compile, which is kind of a deal-breaker for me.
leeoniyaover 5 years ago
also <a href="https:&#x2F;&#x2F;packem.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;packem.github.io&#x2F;</a><p>and another build tool that&#x27;s perf optimized: <a href="https:&#x2F;&#x2F;github.com&#x2F;swc-project&#x2F;swc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;swc-project&#x2F;swc</a>
评论 #21962898 未加载
Waterluvianover 5 years ago
I gave this a try for one of my experiments, replacing rollup. Wow. It just works and cleans up a bunch of dependencies.<p>All I need now is some one shot solution for eslint + prettier. Right now that&#x27;s 7 dependencies, representing almost all the dependencies I add to most of my mini projects.
andraasparover 5 years ago
Parcel is broken on Windows. Since 2018. <a href="https:&#x2F;&#x2F;github.com&#x2F;parcel-bundler&#x2F;parcel&#x2F;issues&#x2F;1990" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;parcel-bundler&#x2F;parcel&#x2F;issues&#x2F;1990</a>
Waterluvianover 5 years ago
How far from zero config do I have to go if I want typescript and jsx? The result is a single bundle.js?
评论 #21963091 未加载
a_bandover 5 years ago
Parcel is one of my favorite open-source projects. Love to see it getting some attention here.
sandGorgonover 5 years ago
Is there a Parcel equivalent of create-react-app ?
评论 #21967379 未加载
nfRfqX5nover 5 years ago
is there something better than gulp for older projects that don&#x27;t use imports? basically concatting scoped JS
ausjkeover 5 years ago
great and easy alternatives to webpack, I&#x27;m surprised its website appears to be mentioned first time at HN.
评论 #21962607 未加载
jjordanover 5 years ago
How does this compare to webpack?
gavrehover 5 years ago
Parcel vs Rollup?
dblotskyover 5 years ago
Just use Make.<p>Takes just as long to learn, and is transferrable everywhere.
评论 #21963471 未加载
评论 #21967024 未加载
toastalover 5 years ago
We should have a gentleman&#x27;s agreement to stop saying &quot;blazing&quot; + &quot;fast&quot;.
评论 #21963453 未加载
评论 #21962867 未加载
评论 #21963963 未加载
评论 #21962377 未加载
bishalbover 5 years ago
Does anyone else cringe when they read &quot;blazing fast&quot; X? Seems like &quot;blazing fast&quot; is thrown around too easily these days.
评论 #21963977 未加载
fiatjafover 5 years ago
I still don&#x27;t understand why everybody is using Webpack when Browserify is easier, simpler, faster, produces smaller builds, can be understood by a normal person. Really, the big shift from Browserify to Webpack happened to fast and without any clear reason.<p>With that said, it&#x27;s good that someone is challenging Webpack, as that must happen for the sanity of all.