Skip to content

Commit 7c0091e

Browse files
authored
fix(browser): inject Buffer (#11714)
* Fix * Remove known issues
1 parent abd35d5 commit 7c0091e

File tree

3 files changed

+0
-49
lines changed

3 files changed

+0
-49
lines changed

packages/rspack/rslib.browser.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ export default defineConfig({
6767
},
6868
plugins: [
6969
pluginNodePolyfill({
70-
globals: {
71-
Buffer: false
72-
},
7370
overrides: {
7471
fs: path.resolve("./src/browser/fs"),
7572
buffer: path.resolve("./src/browser/buffer")

website/docs/en/api/javascript-api/browser.mdx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -227,26 +227,3 @@ new rspack.BrowserHttpImportEsmPlugin({
227227

228228
3. All [ModuleFederationPlugin.shared](/plugins/webpack/module-federation-plugin#shared) configurations must set `import: false`, meaning that consumer projects bundled online cannot bundle shared modules themselves; shared modules must be provided by pre-bundled provider projects.
229229
4. [ModuleFederationPlugin.implementation](/plugins/webpack/module-federation-plugin#implementation) option is not supported.
230-
231-
## Known issues
232-
233-
- [napi-rs#2867](https://github.com/napi-rs/napi-rs/issues/2867): Currently, in projects using `@rspack/browser`, you need to inject `process.env.NODE_DEBUG_NATIVE`.
234-
If you are using Rspack to bundle your project, you can set it with [DefinePlugin](/plugins/webpack/define-plugin):
235-
236-
```js title="rspack.config.mjs"
237-
new rspack.DefinePlugin({
238-
'process.env.NODE_DEBUG_NATIVE': JSON.stringify(false),
239-
});
240-
```
241-
242-
if you are using Rsbuild to bundle your project, you can set it with [source.define](https://rsbuild.rs/config/source/define#sourcedefine):
243-
244-
```ts title="rsbuild.config.ts"
245-
export default {
246-
source: {
247-
define: {
248-
'process.env.NODE_DEBUG_NATIVE': JSON.stringify(false),
249-
},
250-
},
251-
};
252-
```

website/docs/zh/api/javascript-api/browser.mdx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,3 @@ new rspack.BrowserHttpImportEsmPlugin({
225225

226226
3. 所有 [ModuleFederationPlugin.shared](/plugins/webpack/module-federation-plugin#shared) 配置必须设置 `import: false`,即在线打包的消费者项目不能打包共享模块,共享模块必须由预先打包好的生产者项目提供。
227227
4. 不支持设置 [ModuleFederationPlugin.implementation](/plugins/webpack/module-federation-plugin#implementation) 选项。
228-
229-
## 已知问题
230-
231-
- [napi-rs#2867](https://github.com/napi-rs/napi-rs/issues/2867): 目前你需要在使用了 `@rspack/browser` 的项目中注入 `process.env.NODE_DEBUG_NATIVE`
232-
如果你正在使用 Rspack 打包你的项目,那么可以使用 [DefinePlugin](/plugins/webpack/define-plugin)
233-
234-
```js title="rspack.config.mjs"
235-
new rspack.DefinePlugin({
236-
'process.env.NODE_DEBUG_NATIVE': JSON.stringify(false),
237-
});
238-
```
239-
240-
如果你正在使用 Rsbuild 打包你的项目,那么可以使用 [source.define](https://rsbuild.rs/config/source/define#sourcedefine)
241-
242-
```ts title="rsbuild.config.ts"
243-
export default {
244-
source: {
245-
define: {
246-
'process.env.NODE_DEBUG_NATIVE': JSON.stringify(false),
247-
},
248-
},
249-
};
250-
```

0 commit comments

Comments
 (0)