Skip to content

Commit dc1bca1

Browse files
committed
chore: document new ssr methods in vue-template-compiler
1 parent 67fe6cb commit dc1bca1

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

packages/vue-template-compiler/README.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@ This is only useful at runtime with pre-configured builds, so it doesn't accept
7979
8080
---
8181
82+
### compiler.ssrCompile(template, [options])
83+
84+
> 2.4.0+
85+
86+
Same as `compiler.compile` but generates SSR-specific render function code by optimizing parts of the template into string concatenation in order to improve SSR performance.
87+
88+
This is used by default in `vue-loader@>=12` and can be disabled using the [optimizeSSR](https://vue-loader.vuejs.org/en/options.html#optimizessr) option.
89+
90+
---
91+
92+
### compiler.ssrCompileToFunction(template)
93+
94+
> 2.4.0+
95+
96+
Same as `compiler.compileToFunction` but generates SSR-specific render function code by optimizing parts of the template into string concatenation in order to improve SSR performance.
97+
98+
---
99+
82100
### compiler.parseComponent(file, [options])
83101
84102
Parse a SFC (single-file component, or `*.vue` file) into a descriptor (refer to the `SFCDescriptor` type in [flow declarations](https://github.com/vuejs/vue/blob/dev/flow/compiler.js)). This is used in SFC build tools like `vue-loader` and `vueify`.
@@ -89,5 +107,5 @@ Parse a SFC (single-file component, or `*.vue` file) into a descriptor (refer to
89107
90108
`pad` is useful when you are piping the extracted content into other pre-processors, as you will get correct line numbers or character indices if there are any syntax errors.
91109
92-
- with `{ pad: "line" }`, the extracted content for each block will be prefixed with one newline for each line in the leading content from the original file to ensure that the line numbers align with the original file.
93-
- with `{ pad: "space" }`, the extracted content for each block will be prefixed with one space for each character in the leading content from the original file to ensure that the character count remains the same as the original file.
110+
- with `{ pad: "line" }`, the extracted content for each block will be prefixed with one newline for each line in the leading content from the original file to ensure that the line numbers align with the original file.
111+
- with `{ pad: "space" }`, the extracted content for each block will be prefixed with one space for each character in the leading content from the original file to ensure that the character count remains the same as the original file.

0 commit comments

Comments
 (0)