source

Options for input source code.

source.assetsIncludesource.includesource.include

Include additional files that should be treated as static assets.

source.decoratorssource.decoratorssource.decorators

Used to configure the decorators syntax.

If experimentalDecorators is enabled in tsconfig.json, Rslib will set source.decorators.version to legacy by default.

source.definesource.definesource.define

Replaces variables in your code with other values or expressions at compile time. This can be useful for allowing different behavior between development builds and production builds.

source.entrysource.entrysource.entry

Used to set the entry modules for building.

In Rslib, the default value is:

  • bundle mode:
const defaultEntry = {
  // default support for other suffixes such as ts, tsx, jsx, mjs, cjs
  index: 'src/index.js',
};
  • bundleless mode:
const defaultEntry = {
  index: 'src/**',
};
INFO

Check out the lib.bundle to learn more about how to set entry for bundle and bundleless project.

source.excludesource.excludesource.exclude

Specifies JavaScript/TypeScript files that do not need to be compiled.

source.includesource.includesource.include

Specify additional JavaScript files that need to be compiled.

source.transformImportsource.transformImportsource.transformImport

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.

source.tsconfigPathsource.tsconfigPathsource.tsconfigPath

Configure a custom tsconfig.json file path to use, can be a relative or absolute path.