From a99a256aeb717cf16fd5a28273f94c74c397a5f8 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 18 Jun 2024 18:25:09 +0800 Subject: [PATCH] fix(plugin-preact-refresh): missing plugin type (#6850) --- README.zh-CN.md | 2 +- packages/rspack-plugin-preact-refresh/src/index.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index f35208b2ec48..1259b891bad5 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -77,7 +77,7 @@ Rspack 是一个基于 Rust 编写的高性能 JavaScript 打包工具,它提 - [react-refresh-webpack-plugin](https://github.com/pmmmwh/react-refresh-webpack-plugin) 项目(由 [@pmmmwh](https://github.com/pmmmwh) 创建),它启发了 Rspack 内的 ReactRefreshPlugin 实现。 - [prefresh](https://github.com/preactjs/prefresh) 项目(由 [@Jovi De Croock](https://github.com/JoviDeCroock) 创建),它启发了 Rspack 内的 PreactRefreshPlugin 实现。 - [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) 项目(由 [@sokra](https://github.com/sokra) 创建),它启发了 Rspack 内的 CssExtractPlugin 实现。 -- [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) 项目(由 [@kevlened](https://github.com/kevlened) 创建),它启发了 Rsapck 内的 CopyPlugin 实现。 +- [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) 项目(由 [@kevlened](https://github.com/kevlened) 创建),它启发了 Rspack 内的 CopyPlugin 实现。 ## License diff --git a/packages/rspack-plugin-preact-refresh/src/index.ts b/packages/rspack-plugin-preact-refresh/src/index.ts index 2eea28cdbabf..9e0889c0b956 100644 --- a/packages/rspack-plugin-preact-refresh/src/index.ts +++ b/packages/rspack-plugin-preact-refresh/src/index.ts @@ -50,9 +50,9 @@ const INTERNAL_PATHS = [ const runtimeSource = fs.readFileSync(RUNTIME_INTERCEPT_PATH, "utf-8"); -const NAME = "PreactRefreshRsapckPlugin"; +const NAME = "PreactRefreshRspackPlugin"; -class PreactRefreshRsapckPlugin implements RspackPluginInstance { +class PreactRefreshRspackPlugin implements RspackPluginInstance { name = NAME; constructor(private options: IPreactRefreshRspackPluginOptions) { @@ -117,4 +117,5 @@ class PreactRefreshRsapckPlugin implements RspackPluginInstance { } } -module.exports = PreactRefreshRsapckPlugin; +// @ts-expect-error output module.exports +export = PreactRefreshRspackPlugin;