mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
docs(lib): show example entry file (#7233)
This commit is contained in:
parent
6c08c863b5
commit
cb10ebfc25
@ -145,6 +145,15 @@ module.exports = defineConfig({
|
||||
})
|
||||
```
|
||||
|
||||
The entry file would contain exports that can be imported by users of your package:
|
||||
|
||||
```js
|
||||
// lib/main.js
|
||||
import Foo from './Foo.vue'
|
||||
import Bar from './Bar.vue'
|
||||
export { Foo, Bar }
|
||||
```
|
||||
|
||||
Running `vite build` with this config uses a Rollup preset that is oriented towards shipping libraries and produces two bundle formats: `es` and `umd` (configurable via `build.lib`):
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user