Skip to content

Commit

Permalink
docs: patch necessary changes (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 authored Feb 2, 2025
1 parent dedfc5e commit 7d37150
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions website/docs/en/guide/solution/nodejs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Rslib offers seamless support for Node.js projects, allowing you to build Node.j

For example, in `rslib.config.ts`:

```ts
```ts title="rslib.config.ts"
import { defineConfig } from '@rslib/core';

export default defineConfig({
Expand Down Expand Up @@ -62,9 +62,9 @@ All Node.js [built-in modules](https://nodejs.org/docs/latest/api/) are external

### Shims

- `global`: leave it as it is, while it's recommended to use[globalThis](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) instead.
- `__filename`: When outputting in ESM format, replace`__filename` with the result of`fileURLToPath(import.meta.url)`.
- `__dirname`: When outputting in ESM format, replace`__dirname` with the result of`dirname(fileURLToPath(import.meta.url))`.
- `global`: leave it as it is, while it's recommended to use [globalThis](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) instead.
- `__filename`: When outputting in ESM format, replace `__filename` with the result of `fileURLToPath(import.meta.url)`.
- `__dirname`: When outputting in ESM format, replace `__dirname` with the result of `dirname(fileURLToPath(import.meta.url))`.

{/* TODO: Rspack doesn't support createRequire now */}
{/* ### createRequire */}
Expand Down
12 changes: 6 additions & 6 deletions website/docs/en/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Setup environment

Before getting started, you will need to install [Node.js](https://nodejs.org/) >= version 16. We recommend using the Node.js LTS version.
Before getting started, you will need to install [Node.js](https://nodejs.org/) >= version 16, it is recommended to use the Node.js LTS version.

Check the current Node.js version with the following command:

```bash
node -v
```

If you do not have Node.js installed in your current environment, or the installed version is too low, you can use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to install.
If you do not have Node.js installed in current environment, or the installed version is too low, you can use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to install.

Here is an example of how to install via nvm:

Expand Down Expand Up @@ -81,7 +81,7 @@ We're working to provide templates for more frameworks (such as Vue).
```

:::tip
Biome provides combined linting and formatting features. If you select Biome, you typically won't need ESLint or Prettier.
Biome provides similar linting and formatting features to ESLint and Prettier. If you select Biome, you typically won't need to choose ESLint or Prettier as well.
:::

### Current directory
Expand All @@ -100,7 +100,7 @@ If you need to create a project in the current directory, you can set the target

### Quick creation

[create-rslib](https://www.npmjs.com/package/create-rslib) provides command-line options / flags. By setting these CLI flags, you can skip the interactive selection steps and create the project with one command.
[create-rslib](https://www.npmjs.com/package/create-rslib) provides some CLI flags. By setting these CLI flags, you can skip the interactive selection steps and create the project with one command.

For example, to create an example project in the `my-project` directory with one command:

Expand All @@ -111,7 +111,7 @@ npx create-rslib --dir my-project --template example
npx create-rslib -d my-project -t example
```

Current flags for `create-rslib`:
All the CLI flags of `create-rslib`:

```text
Usage: create-rslib [options]
Expand All @@ -136,7 +136,7 @@ To migrate from an existing project to Rslib, refer to the following guides:

For other types of projects, you can manually install the [@rslib/core](https://www.npmjs.com/package/@rslib/core) package:

`<PackageManagerTabs command="add @rslib/core -D" />`
<PackageManagerTabs command="add @rslib/core -D" />

Then refer to the guide and documentation to enable the features you need:

Expand Down

0 comments on commit 7d37150

Please sign in to comment.