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
{{ message }}
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: docs/README.md
+13-10
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,20 @@
4
4
This is the documentation for Rollup Plugin Vue v4 and above. If you are upgrading from v2 or an earlier version, check out the [Migration Guide](./migrating.md). If you are using an older version, the old docs are [here](https://github.com/vuejs/rollup-plugin-vue/tree/2.2/docs).
5
5
:::
6
6
7
-
## What is Rollup Plugin Vue?
7
+
## What does Rollup Plugin Vue do?
8
8
9
-
`rollup-plugin-vue` is a plugin for [rollup](https://rollupjs.org/) that allows you to author Vue components in a format called [Single-File Components (SFCs)](https://vue-loader.vuejs.org/spec.html):
9
+
This is a plugin for [rollup](https://rollupjs.org/) that allows you to author Vue components in a format called [Single-File Components (SFCs)](https://vue-loader.vuejs.org/spec.html). They look like this:
10
10
11
11
```vue
12
12
<template>
13
-
<div class="example">{{ msg }}</div>
13
+
<div class="example">{{ message }}</div>
14
14
</template>
15
15
16
16
<script>
17
17
export default {
18
18
data () {
19
19
return {
20
-
msg: 'Hello world!'
20
+
message: 'Hello world!'
21
21
}
22
22
}
23
23
}
@@ -30,11 +30,14 @@ export default {
30
30
</style>
31
31
```
32
32
33
-
There are many cool features provided by `rollup-plugin-vue`:
33
+
This plugin also enables:
34
34
35
-
- Feature parity with [vue-loader](https://vue-loader.vuejs.org)
36
-
- Allows custom blocks in a `.vue` file;
37
-
- Treat static assets referenced in `<style>` and `<template>` as module dependencies;
38
-
- Simulate scoped CSS for each component.
35
+
- scoped CSS
36
+
- custom blocks
37
+
- static assets references within `<style>` and `<template>`
39
38
40
-
Rollup is a module bundler which makes `rollup-plugin-vue` ideal for packaging Vue plugins and UI component libraries.
39
+
And many other other features, maintaining parity with [Vue Loader](https://vue-loader.vuejs.org).
40
+
41
+
## Why should I use Rollup over Webpack?
42
+
43
+
Rollup offers optimizations like tree shaking that make it ideal for building shared libraries. This plugin also prioritizes defaults that are ideal for most Vue plugins and UI component libraries.
Copy file name to clipboardExpand all lines: docs/examples.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Cookbook
1
+
# Examples
2
2
3
-
The Cookbook gives developers examples to work off of that both cover common or interesting use cases, and also progressively explain more complex detail. Our goal is to move beyond a simple introductory example, and demonstrate concepts that are more widely applicable, as well as some caveats to the approach.
3
+
These examples cover most common or interesting use cases, and also progressively explain more complex detail. Our goal is to move beyond a simple introductory example, and demonstrate concepts that are more widely applicable, as well as some caveats to the approach.
@@ -142,21 +143,21 @@ See [`vue-template-compiler` options reference](https://github.com/vuejs/vue/tre
142
143
143
144
During template compilation, the compiler can transform certain attributes, such as `src` URLs, into `require` calls, so that the target asset can be handled by webpack. For example, `<img src="./foo.png">` will attempt to locate the file `./foo.png` on your file system and include it as a dependency of your bundle.
Force production mode, which prohibits the plugin from emitting code that is development-only.
151
152
152
-
### template.optimizeSSR
153
+
### `template.optimizeSSR`
153
154
154
155
- type: `boolean`
155
156
- default: `process.env.VUE_ENV === 'server'`
156
157
157
158
Enable Vue 2.4 SSR compilation optimization that compiles part of the vdom trees returned by render functions into plain strings, which improves SSR performance. In some cases you might want to explicitly turn it off because the resulting render functions can only be used for SSR and cannot be used for client-side rendering or testing.
158
159
159
-
### template.transpileOptions
160
+
### `template.transpileOptions`
160
161
161
162
- type: `Object`
162
163
- default: `{}`
@@ -165,17 +166,17 @@ Configure ES2015+ to ES5 transpiling options for the generated render function c
165
166
166
167
The template render functions compilation supports a special transform `stripWith` (enabled by default), which removes the `with` usage in generated render functions to make them strict-mode compliant.
0 commit comments