Skip to content

0.21.1

Choose a tag to compare

@bvaughn bvaughn released this 11 Oct 11:48
· 1 commit to main since this release

The component's behavior is unchanged, but the package is now built with Vite instead of webpack. Check the packaging changes below if you use an older bundler or runtime, or load the UMD build.

  • Add TypeScript type definitions (dist/react-highlight-words.d.ts), including exported HighlighterProps, HighlightTagProps, UnhighlightTagProps, Chunk and FindChunksOptions types.
  • Add an ES module build (dist/react-highlight-words.js), exposed through the module field.
  • Move the CommonJS entry point from dist/main.js to dist/react-highlight-words.cjs. require("react-highlight-words") still returns the component directly.
  • Target modern JavaScript (ES2018+: object spread, destructuring defaults, const/let) instead of ES5. Environments that can't parse that syntax need to transpile the package.
  • Stop bundling highlight-words-core into the build; it is installed as a regular dependency (^1.2.0).
  • Lowercase the keys of an object highlightClassName once per render instead of once per match (when caseSensitive is false).
  • Remove the UMD build (dist/main.umd.js).
  • Remove the memoize-one dependency.