You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/en/guide/faq/exceptions.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
# Exceptions FAQ
2
2
3
-
### Find ESNext code in the compiled files?
3
+
### Seeing ESNext code in the compiled files?
4
4
5
-
By default, Rsbuild does not compile JavaScript files under`node_modules`. If an npm package contains ESNext syntax, it will be bundled into the output.
5
+
By default, Rsbuild does not compile JavaScript files in`node_modules`. If an npm package includes ESNext syntax, that code is bundled as is.
6
6
7
7
To compile these files, use the [source.include](/config/source/include) configuration to specify additional directories or modules.
8
8
9
9
---
10
10
11
-
### Build error `Error: [object Object] is not a PostCSS plugin`?
11
+
### Build error `Error: [object Object] is not a PostCSS plugin`?
12
12
13
-
Rsbuild uses PostCSS v8. If you encounter the `Error: [object Object] is not a PostCSS plugin`error during compilation, it's usually caused by using an incompatible version of PostCSS. For example, the `postcss` peer dependency version in `cssnano` may not match the expected version.
13
+
Rsbuild uses PostCSS v8. If you encounter this error during compilation, it's usually because a package is using an incompatible PostCSS version. For example, the `postcss` peer dependency version in `cssnano` may not match the expected version.
14
14
15
15
To find unmet peer dependencies, run `npm ls postcss`. Then fix the issue by specifying the correct PostCSS version in your package.json.
16
16
@@ -37,13 +37,13 @@ File was processed with these loaders:
37
37
You may need an additional loader to handle the result of these loaders.
38
38
```
39
39
40
-
Check whether you're referencing unsupported file formats, and configure the appropriate Rspack loader to handle them.
40
+
Check whether you're importing unsupported file formats, and configure the appropriate Rspack loader to handle them.
41
41
42
42
---
43
43
44
44
### Compilation error `export 'foo' (imported as 'foo') was not found in './utils'`?
45
45
46
-
This error means your code is importing an export that doesn't exist.
46
+
This error means your code is importing a symbol that doesn't exist.
47
47
48
48
For example, in the following code, `index.ts` is importing the `foo` variable from `utils.ts`, but `utils.ts` only exports the `bar` variable.
In some cases, a third-party dependency you can't modify causes this error. If you're certain the issue doesn't affect your application, you can change the log level from `error` to `warn`:
91
+
In some cases, a third-party dependency you can't modify causes this error. If you're sure it doesn't affect your application, you can downgrade the log level from `error` to `warn`:
Copy file name to clipboardExpand all lines: website/docs/en/guide/faq/features.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Features FAQ
2
2
3
-
### How to import UI component library on demand?
3
+
### How to import a UI component library on demand?
4
4
5
-
To configure the on-demand import of the component library, you can configure it through [source.transformImport](/config/source/transform-import), which is equivalent to[babel-plugin-import](https://npmjs.com/package/babel-plugin-import).
5
+
To enable on-demand imports for a component library, configure [source.transformImport](/config/source/transform-import). This works the same way as[babel-plugin-import](https://npmjs.com/package/babel-plugin-import).
6
6
7
7
```ts
8
8
exportdefault {
@@ -22,13 +22,13 @@ export default {
22
22
23
23
### How to run ESLint during compilation?
24
24
25
-
For the sake of compilation performance, Rsbuild will not perform ESLint verification during the compilation process by default. If you require this feature, you can use Rsbuild's[ESLint plugin](https://github.com/rspack-contrib/rsbuild-plugin-eslint).
25
+
To protect compilation performance, Rsbuild doesn't run ESLint checks during builds by default. If you need ESLint in the pipeline, use the[ESLint plugin](https://github.com/rspack-contrib/rsbuild-plugin-eslint).
26
26
27
27
---
28
28
29
29
### How to configure CDN path for static assets?
30
30
31
-
To upload static assets such as JS and CSS to CDN for use, set the URL prefix of static assets through the [output.assetPrefix](/config/output/asset-prefix) configuration.
31
+
To serve static assets like JS and CSS from a CDN, set the asset URL prefix with [output.assetPrefix](/config/output/asset-prefix).
32
32
33
33
```js
34
34
exportdefault {
@@ -42,17 +42,17 @@ export default {
42
42
43
43
### How to remove console after production build?
44
44
45
-
For the production build, we can remove the `console`from the code, so as to avoid the log of the development mode being output to the production.
45
+
In production builds, you can strip `console`calls to avoid shipping development logs.
46
46
47
-
Rsbuild provides a configuration option to remove console by default, please see[performance.removeConsole](/config/performance/remove-console).
47
+
Rsbuild provides a built-in option for removing console statements. See[performance.removeConsole](/config/performance/remove-console).
48
48
49
49
---
50
50
51
51
### How to view the final generated Rspack configuration?
52
52
53
-
By using the Rsbuild debug mode, you can view the Rspack configuration generated by Rsbuild.
53
+
Use Rsbuild's debug mode to view the Rspack configuration that Rsbuild generates.
54
54
55
-
You can enable the debug mode of Rsbuild by adding the `DEBUG=rsbuild` environment variable when performing the build. In this mode, the internally generated Rspack configuration will be outputted to the "dist" directory.
55
+
Enable debug mode by setting the `DEBUG=rsbuild` environment variable when running a build. In this mode, the generated Rspack configuration is written to the `dist` directory.
By default, Rsbuild will print all error and warning logs generated by the build process.
76
+
By default, Rsbuild prints all errors and warnings from the build.
77
77
78
-
If a large number of warning logs are generated by a third-party package and you want to ignore them, specific warning logs can be ignored through the `ignoreWarnings` configuration provided by Rspack.
78
+
If a noisy third-party package produces many warnings, you can silence specific messages with Rspack's `ignoreWarnings` configuration.
0 commit comments