Comments (7)
It's true that rspack document is not always up-to-date, which is a problem(I don't know how the team will improve this workflow in the future).
For now, we know rspack aims for alignment with webpack, so you may find some available configuration in webpack document such as https://webpack.js.org/configuration/optimization/#optimizationconcatenatemodules.
As for why it's not enabled by default in production mode, I guess this option was forgotten to be adjusted at the end of the experimental phase.
rspack:
rspack/packages/rspack/src/config/defaults.ts
Line 916 in 4fcc42c
webpack: https://github.com/webpack/webpack/blob/8241da7f1e75c5581ba535d127fa66aeb9eb2ac8/lib/config/defaults.js#L1152
#6769
I'll make a simple pull request.
from rspack.
webpack/rspack generates runtime code for every small module. Maybe concatenateModules
could help.
from rspack.
This build runs in production mode — so I assumed module concatenation would be on.
from rspack.
🤔 I manually set concatenateModules
to true on top of your config and it did work.
File Size Gzipped
rsbuild-dist/index.html 0.32 kB 0.22 kB
rsbuild-dist/static/js/index.3a9fa5b5.js 1.4 kB 0.74 kB
rsbuild-dist/static/js/712.32ef6620.js 26.4 kB 8.0 kB
Total size: 28.1 kB
Gzipped size: 8.9 kB
from rspack.
Interesting, I don't see such an option documented here —
https://www.rspack.dev/config/optimization
Where is this documented?
Also, would you know why this isn't enabled by default?
from rspack.
@CPunisher concatenateModules is not enabled in production because we're still testing it, we will enable it by default in production when we think it's production ready
from rspack.
@hardfist 😄 That's what I'm going to ask. After I changed the default configuration, there are some test cases with strange errors.
from rspack.
Related Issues (20)
- [Bug]: fix types for transform `CopyRspackPlugin` HOT 1
- [Feature]: support for exclude option by SwcCssMinimizerRspackPlugin
- [Bug]: `fork-ts-checker-webpack-plugin` intermittently and frequently breaks when building / using dev-server HOT 1
- [Bug]: compatibility plugin not works well
- [Bug]: Panic when `concatenateModules` and `CssExtractRspackPlugin` used HOT 3
- [Bug]: reexport will have duplicate key in object
- test: add more test cases for runtime ids and condition expression
- Dev Server errors on code changes: StringExpected, Failed to convert JavaScript value `Undefined` into rust type `String` HOT 1
- [Bug]: SVG external references unofficially work with hacks HOT 1
- [Bug]: Reopen https://github.com/web-infra-dev/rspack/issues/6714 HOT 1
- [Bug]: web worker error in host HOT 1
- [Bug]: incorrect LICENSE.txt
- [Bug]: Global polyfill no longer seems to work HOT 2
- [Bug]: Vue2, code-inspector-plugin, yield "Calling promisify on a function that returns a Promise is likely a mistake"
- [Bug]: rspack转化ts结果不符合预期,typeof语句被转为0 HOT 3
- docs: add api description of externalsPlugin
- [Bug]: ProgressPlugin: time is NaN HOT 1
- [Bug]: The development mode is normal, and the packaging is reported to report an error HOT 4
- [Bug]: (1.0.0-alpha)Js API rspack build out info no have gzip info
- [Bug]: bad case of unused pure expression
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspack.