Modern.js Builder is a Build Engine for web development.
With the growing of the front-end ecosystem, more and more build tools and plugins are created. For most developers, the configuration and dependencies required to build a web application have become complex; the cost of finding best practices for developers has also risen.
In order to reduce the complexity and make it easier to build a project, we abstracted the build abilities based on the practical experience of Modern.js, and created the open source tool Modern.js Builder.
Modern.js Builder is a build tool serving the upper-level front-end frameworks. It focuses on solving problems in web application building, and expects to provide out-of-box building abilities for front-end frameworks.
If you are developing a front-end framework, or developing a scaffolding for a front-end application, Builder can provide most of the build logics for you, which allowing you to focus on implementing other features of the framework.
If you are a business developer, in most cases, you do not need to manually install Builder in your projects. We recommend that you use the upper-level frameworks based on Builder.
Currently, the following front-end frameworks are already using Builder:
Builder supports both webpack and Rspack, so you can switch between the stable Webpack and the faster Rspack.
Compared to webpack, Rspack has significantly improved build performance, thanks not only to the language advantages brought by Rust, but also to its parallel architecture and incremental compilation features. Benchmarking has shown that Rspack can provide 5-10 times better compilation performance.
By default, Builder uses webpack 5 as the bundler. Although the compilation speed of webpack is not ideal, it is still the most mature and ecological bundler in the community. Based on webpack, Builder integrates Babel, PostCSS, terser and other tools to transform or minify codes. Builder also supports replacing some compile tools with native tools to improve compilation speed, such as replacing babel/terser with swc or esbuild.
If you have higher build performance requirements, you can easily switch to Rspack build mode, see Using Rspack for more information.
Builder makes full use of various optimization strategies in the webpack ecosystem to ensure the artifacts performance in the production environment.
Taking the chunk splitting scenario as an example, the webpack's splitChunks config is complex, and Builder makes it as an out-of-the-box performance.chunkSplit config, it will split common third-party libraries into chunks to make page loading faster.
Provides rich configuration options and a flexible plugin system to support in-depth customization of all features.
For Builder, all building abilities are achieved through plugins:
Builder also supports custom plugins, so framework developers can develop custom plugins to meet customized requirements.
Below is the npm package published by Builder.
|@modern-js/builder||Core package of Builder|
|@modern-js/builder-cli||CLI of Builder|
|@modern-js/builder-webpack-provider||Provides webpack build ability|
|@modern-js/builder-rspack-provider||Provides Rspack build ability|
|@modern-js/builder-plugin-vue||Vue 3 Plugin|
|@modern-js/builder-plugin-vue2||Vue 2 Plugin|
|@modern-js/builder-plugin-node-polyfill||Node Polyfill Plugin|
|@modern-js/builder-plugin-image-compress||Image Compress Plugin|
|@modern-js/builder-shared||Shared modules of Builder|
|@modern-js/builder-doc||Documentation snippets of Builder|
You can view the source code of these packages in the packages/builder directory of the modern.js repository.
You may want: