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
{ outDir: string; content: string }|content: The comment content of the banner<br>outDir: The output directory from vite|[Optional parameter format](#optional-parameter-format)
37
+
38
+
## Usage
39
+
40
+
In most cases, just use the `String` format as a plugin option.
41
+
42
+
In some special cases, such as in [VitePress](https://vitepress.vuejs.org/), you need to use `Object` format to pass in plugin options, see [Optional parameter format](#optional-parameter-format).
43
+
31
44
### Basic usage
32
45
33
46
Add it to `vite.config.ts`
34
47
35
48
```ts
36
49
// vite.config.ts
37
-
importBannerfrom'vite-plugin-banner'
50
+
importbannerfrom'vite-plugin-banner'
38
51
// Other dependencies...
39
52
40
53
exportdefaultdefineConfig({
41
54
plugins: [
42
-
Banner('This is the Banner content.'),
55
+
banner('This is the banner content.'),
43
56
]
44
57
})
45
58
```
@@ -49,7 +62,7 @@ When you run `npm run build` on your project, In the `dist` folder(Or the [build
49
62
e.g. in `app.b3a7772e.js`:
50
63
51
64
```js
52
-
/* This is the Banner content. */
65
+
/* This is the banner content. */
53
66
var e=Object.assign;import{Mast,dasa,uasr,c......
54
67
```
55
68
@@ -60,7 +73,6 @@ Of course, the most ideal banner is related to your package information.
Because in VitePress, what you get through `viteConfig.build.outDir` is always a `.temp` temporary directory, not the final output directory, so you need to manually specify the output directory to inform the plugin
0 commit comments