Options for input source code.
Include additional files that should be treated as static assets.
Used to configure the decorators syntax.
If experimentalDecorators is enabled in tsconfig.json
, Rslib will set source.decorators.version
to legacy
by default.
Replaces variables in your code with other values or expressions at compile time. This can be useful for injecting env variables and other information to the code during build time.
Used to set the entry modules for building.
In Rslib, the default value is:
Check out the lib.bundle to learn more about how to set entry for bundle and bundleless project.
Exclude JavaScript or TypeScript files that do not need to be transformed by SWC.
Files configured in source.exclude
will not be transformed by SWC, but the referenced files will still be bundled into the outputs.
If you want certain files not to be bundled into the outputs, you can use the following methods:
source.entry
to configure the corresponding glob expression, refer to Set entry.Specify additional JavaScript files that need to be compiled.
Transform the import path, which can be used to modularly import the subpath of third-party packages. The functionality is similar to babel-plugin-import.
Configure a custom tsconfig.json file path to use, can be a relative or absolute path.