Home > @lynx-js/rspeedy > Source > include
The source.include
is used to specify additional JavaScript files that need to be compiled.
Signature:
To avoid redundant compilation, by default, Rsbuild only compiles JavaScript files in the current directory and TypeScript and JSX files in all directories. It does not compile JavaScript files under node_modules
.
Through the source.include
config, you can specify directories or modules that need to be compiled by Rsbuild. The usage of source.include
is consistent with Rule.include in Rspack, which supports passing in strings or regular expressions to match the module path.
A typical usage scenario is to compile npm packages under node_modules
, because some third-party dependencies have ESNext syntax, which may not be supported in Lynx. You can solve the problem by using this config to specify the dependencies that need to be compiled.