(தུ)This is why webpack exists. It's a tool that lets you bundle your JavaScript applications (supporting both ESM and CommonJS), and it can be extended to support many different assets such as images, fonts and stylesheets.
It uses the new standardized format for code modules included in the ES6 revision of JavaScript, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries.
Rollup allows you to write your code using the new module system, and will then compile it back down to existing supported formats such as CommonJS modules, AMD modules, and IIFE-style scripts.
• چܗࣜ(CommonJS ͳͲ)ʹͤΔ
• https://rollupjs.org/guide/en/#compatibility
Rollup can import existing CommonJS modules through a plugin.
Think of esbuild as a "linker" for the web. It knows how to transform and bundle JavaScript and CSS. But the details of how your source code ends up as plain JavaScript or CSS may need to be 3rd-party code.
I'm building esbuild because I fi nd it fun to build and because it's the tool I'd want to use.
• →ͱʹ͔͘Ϗϧυ(όϯυϧ)ͷ͍πʔϧ͕ཉ͔ͬͨ͠
• https://esbuild.github.io/faq/#upcoming-roadmap
I also hope esbuild inspires other build tools to dramatically improve performance by overhauling their implementations so that everyone can bene fi t, not just those that use esbuild.
However, as we start to build more and more ambitious applications, the amount of JavaScript we are dealing with also increased exponentially. It is not uncommon for large scale projects to contain thousands of modules. We are starting to hit a performance bottleneck for JavaScript based tooling
Vite aims to address these issues by leveraging new advancements in the ecosystem: the availability of native ES modules in the browser, and the rise of JavaScript tools written in compile-to-native languages.
Even though native ESM is now widely supported, shipping unbundled ESM in production is still inef fi cient (even with HTTP/2) due to the additional network round trips caused by nested imports.
swc becomes faster and it will be much faster with the next version. Its performance is similar to it of esbuild, even though there are so many low-hanging fruits.
SWCͳͥੜ·Εͨͷ͔ • https://swc.rs/docs/spack-basic/#con fi g- fi le
spack can be con fi gured with spack.con fi g.js. Con fi g fi le for the spack is almost simillar to webpack. In future, I'll add a webpack-compatible plugin system.