Skip to content

v0.5.0

Compare
Choose a tag to compare
@Timeless0911 Timeless0911 released this 19 Feb 09:52
· 219 commits to main since this release
b3cf9ea

Highlights ✨

This release brings exciting new features and improvements to Rslib:

  • Support DTS Redirect: Rslib now supports to control the redirect of the import paths in output TypeScript declaration files. (#742)

    • redirect.dts.path: Redirect the import path in the DTS output file to the corresponding relative path based on the compilerOptions.paths configured in tsconfig.json.
    // For `compilerOptions.paths` set to `{ "@/*": ["src/*"] }` in `tsconfig.json`
    import { foo } from '@/foo'; // source code of './src/bar.ts' ↓
    import { foo } from './foo'; // expected output of './dist/bar.d.ts'
    
    import { foo } from '@/foo'; // source code of './src/utils/index.ts' ↓
    import { foo } from '../foo'; // expected output './dist/utils/index.d.ts'
    • redirect.dts.extension: Redirect the import path in the DTS output file to the corresponding JavaScript extension which can be resolved to corresponding DTS file.
    // For `.d.mts` TypeScript Declaration files
    import { foo } from './foo'; // source code of './src/bar.ts' ↓
    import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts'
    
    import { foo } from './foo.ts'; // source code of './src/bar.ts' ↓
    import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts'
  • Support outBase in Bundleless Mode: When building a project where source files exist across multiple directories with bundleless mode, the output directory structure will be replicated relative to the outBase directory in the output directory, see lib.outBase for more details. (#745)

  • Add Documents about Assets: Documents related to asset module have been added for common scenarios in component library development, see Import static assets, Import SVGR and Import JSON files for more details. (#741)

  • Support pkg.pr.new: With pkg.pr.new, each of commits in main branch will trigger an instant preview release without publishing anything to NPM. This enables users to access features and bug-fixes without the need to wait for release cycles. (#766)

What's Changed

New Features 🎉

Bug Fixes 🐞

Document 📖

Other Changes

Full Changelog: v0.4.1...v0.5.0