Object | Function | undefined
undefined
only support webpack
Using babel-loader or Rspack instead of ts-loader can significantly improve compilation speed and provide better extendability.
ts-loader cannot be used with certain features such as source.transformImport and tools.styledComponents provided by Babel & SWC.
ts-loader
is not enabled by default in the project. When tools.tsLoader
is not undefined, builder will use ts-loader instead of babel-loader to compile TypeScript code.
When this value is an Object, it is merged with the default configuration via Object.assign.
The default configuration is as follows:
You can override the default configuration via the tools.tsLoader
configuration option:
When this value is a Function, the default configuration is passed in as the first parameter, the configuration object can be modified directly, or an object can be returned as the final configuration.The second parameter is the util functions to modify the ts-loader
configuration. For example:
Deprecated, please use source.include instead, both have the same functionality.
Deprecated, please use source.exclude instead, both have the same functionality.