const defaultInclude = [
[
{ not: /[\\/]node_modules[\\/]/ },
/\.(?:ts|tsx|jsx|mts|cts)$/,
],
];source.include is used to specify additional JavaScript files that need to be compiled. By default, the following files will be compiled:
.ts, .tsx, .jsx, .mts, .cts.node_modules directory, with file extensions matching .js, .mjs, .cjs.
Before Rsbuild version 1.4, the default value of source.include was:
const defaultInclude = [
[
{
and: [
APP_ROOT,
{ not: /[\\/]node_modules[\\/]/ }
]
},
/\.(?:ts|tsx|jsx|mts|cts)$/,
],
];The difference from the new version is that .js, .mjs, .cjs files only in the current directory will be compiled.
该配置项的使用方式与 Rsbuild 完全一致。详细信息请参考 Rsbuild - source.include。
To ensure legacy projects can run properly, when using Webpack, the default value of source.include is the same as before Rsbuild version 1.4.