false
Used to analyze whether there is incompatible advanced syntax in the build artifacts under the current browser scope. If any incompatible syntax is found, detailed information will be printed to the terminal.
You can set checkSyntax
to true
to enable syntax checking.
When you enable checkSyntax
, Modern.js will perform the detection during production builds. If any incompatible advanced syntax is detected in the build artifacts, error logs will be printed to the terminal, and the current build process will be terminated.
The format of the error logs is as follows, including the source file, artifact location, error reason, and source code:
Currently, syntax checking is implemented based on AST parser. Each time it performs a check, it can only identify the first incompatible syntax found in the file. If there are multiple incompatible syntaxes in the file, you need to fix the detected syntax and re-run the check.output.disableMinimize to true and rebuild again.
If the corresponding source location is not shown in the log, try setting
If a syntax error is detected, you can handle it in the following ways:
source.include
config.checkSyntax.exclude
configuration to exclude the files to be checked.security.checkSyntax
is implemented based on @rsbuild/plugin-check-syntax
. For specific options, please refer to @rsbuild/plugin-check-syntax.