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: docs/guide/bundler.md
+9-85
Original file line number
Diff line number
Diff line change
@@ -4,69 +4,17 @@ VuePress has been using [webpack](https://webpack.js.org/) as the bundler to dev
4
4
5
5
Although it is possible to create other bundler packages by community users, currently we only suggest to use the bundlers provided by VuePress team.
6
6
7
-
## Webpack
7
+
## Choose a Bundler
8
8
9
-
When using the [vuepress](https://www.npmjs.com/package/vuepress) package, the webpack bundler is installed:
9
+
When using the [vuepress](https://www.npmjs.com/package/vuepress) package, webpack bundler is installed and used automatically.
10
10
11
-
<CodeGroup>
12
-
<CodeGroupItemtitle="YARN"active>
13
-
14
-
```bash
15
-
yarn add -D vuepress@next
16
-
```
17
-
18
-
</CodeGroupItem>
19
-
20
-
<CodeGroupItemtitle="NPM">
21
-
22
-
```bash
23
-
npm install -D vuepress@next
24
-
```
25
-
26
-
</CodeGroupItem>
27
-
</CodeGroup>
28
-
29
-
You can specify the name of the bundler to use in [bundler](../reference/config.md#bundler) option, or omit it because webpack is the default bundler when using `vuepress` package. Then you can set [options of webpack bundler](../reference/bundler/webpack.md) via [bundlerConfig](../reference/config.md#bundlerconfig) option:
You can specify the name of the bundler to use in [bundler](../reference/config.md#bundler) option, or omit it because vite is the default bundler when using `vuepress-vite` package. Then you can set [options of vite bundler](../reference/bundler/vite.md) via [bundlerConfig](../reference/config.md#bundlerconfig) option:
33
+
## Bundler Config
85
34
86
-
<CodeGroup>
87
-
<CodeGroupItemtitle="JS"active>
88
-
89
-
```js
90
-
module.exports= {
91
-
bundler:'@vuepress/vite',
92
-
bundlerConfig: {
93
-
// vite bundler options
94
-
},
95
-
}
96
-
```
97
-
98
-
</CodeGroupItem>
35
+
Generally, you could use a bundler without extra configuration, because we have already configured them properly to work with VuePress.
99
36
100
-
<CodeGroupItemtitle="TS">
37
+
Similar to [themeConfig](../reference/config.md#themeconfig), VuePress also allows users to set bundler config via [bundlerConfig](../reference/config.md#bundlerconfig).
You can refer to [Bundlers > Webpack](../reference/bundler/webpack.md) and [Bundlers > Vite](../reference/bundler/vite.md) to check out all options of the corresponding bundler.
Copy file name to clipboardexpand all lines: docs/reference/bundler/vite.md
+45-1
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,53 @@
2
2
3
3
<NpmBadgepackage="@vuepress/bundler-vite" />
4
4
5
+
Vite bundler is provided by [@vuepress/bundler-vite](https://www.npmjs.com/package/@vuepress/bundler-vite) package. It is a dependency of the [vuepress-vite](https://www.npmjs.com/package/vuepress-vite) package, and you can also install it separately.
6
+
7
+
```bash
8
+
npm i -D @vuepress/bundler-vite@next
9
+
```
10
+
5
11
## Options
6
12
7
-
Reference of webpack bundler config, which can be set via [bundlerConfig](../config.md#bundlerconfig).
13
+
Reference of vite bundler config, which can be set via [bundlerConfig](../config.md#bundlerconfig).
14
+
15
+
<CodeGroup>
16
+
<CodeGroupItemtitle="JS"active>
17
+
18
+
```js
19
+
module.exports= {
20
+
// when using vuepress-vite package, you can omit this field
Copy file name to clipboardexpand all lines: docs/reference/bundler/webpack.md
+44
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,54 @@
2
2
3
3
<NpmBadgepackage="@vuepress/bundler-webpack" />
4
4
5
+
Webpack bundler is provided by [@vuepress/bundler-webpack](https://www.npmjs.com/package/@vuepress/bundler-webpack) package. It is a dependency of the [vuepress](https://www.npmjs.com/package/vuepress) package, and you can also install it separately.
6
+
7
+
```bash
8
+
npm i -D @vuepress/bundler-webpack@next
9
+
```
10
+
5
11
## Options
6
12
7
13
Reference of webpack bundler config, which can be set via [bundlerConfig](../config.md#bundlerconfig).
8
14
15
+
<CodeGroup>
16
+
<CodeGroupItemtitle="JS"active>
17
+
18
+
```js
19
+
module.exports= {
20
+
// when using vuepress package, you can omit this field
Copy file name to clipboardexpand all lines: docs/reference/node-api.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@
2
2
3
3
<NpmBadgepackage="@vuepress/core" />
4
4
5
-
Node API is provided by [@vuepress/core](https://www.npmjs.com/package/@vuepress/core) package. It is a dependency of the [vuepress](https://www.npmjs.com/package/vuepress) package, and you can also install it separately.
5
+
Node API is provided by [@vuepress/core](https://www.npmjs.com/package/@vuepress/core) package. It is a dependency of the [vuepress](https://www.npmjs.com/package/vuepress) package, and you can also install it separately:
0 commit comments