Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Nov 25, 2024
1 parent d870222 commit 00cfbd0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

Rspack plugin that runs TypeScript type checker on a separate process.

[![npm version](https://img.shields.io/npm/v/ts-checker-rspack-plugin.svg)](https://www.npmjs.com/package/ts-checker-rspack-plugin)
[![downloads](http://img.shields.io/npm/dm/ts-checker-rspack-plugin.svg)](https://npmjs.org/package/ts-checker-rspack-plugin)
<p>
<a href="https://npmjs.com/package/ts-checker-rspack-plugin">
<img src="https://img.shields.io/npm/v/ts-checker-rspack-plugin?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
</a>
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
<a href="https://npmcharts.com/compare/ts-checker-rspack-plugin?minimal=true"><img src="https://img.shields.io/npm/dm/ts-checker-rspack-plugin.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
</p>


## Credits

Expand Down Expand Up @@ -165,10 +171,10 @@ When we call this method with a [Rspack compiler instance](https://rspack.dev/ap
[tapable](https://github.com/webpack/tapable) hooks where you can pass in your callbacks.

```js
// ./src/webpack/MyWebpackPlugin.js
// ./src/rspack/MyRspackPlugin.js
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');

class MyWebpackPlugin {
class MyRspackPlugin {
apply(compiler) {
const hooks = TsCheckerRspackPlugin.getCompilerHooks(compiler);

Expand All @@ -181,15 +187,15 @@ class MyWebpackPlugin {
}
}

module.exports = MyWebpackPlugin;
module.exports = MyRspackPlugin;

// rspack.config.js
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
const MyWebpackPlugin = require('./src/webpack/MyWebpackPlugin');
const MyRspackPlugin = require('./src/webpack/MyRspackPlugin');

module.exports = {
/* ... */
plugins: [new TsCheckerRspackPlugin(), new MyWebpackPlugin()],
plugins: [new TsCheckerRspackPlugin(), new MyRspackPlugin()],
};
```

Expand Down

0 comments on commit 00cfbd0

Please sign in to comment.