feat(compiler-core): support mode: cjs in codegen

This commit is contained in:
Evan You
2020-01-30 17:49:42 -05:00
parent 87e8c8094f
commit 04da2a82e8
2 changed files with 11 additions and 6 deletions

View File

@@ -57,8 +57,10 @@ export interface CodegenOptions {
// - Function mode will generate a single `const { helpers... } = Vue`
// statement and return the render function. It is meant to be used with
// `new Function(code)()` to generate a render function at runtime.
// - CommonJS mode is like function mode except it retrives helpers from
// `require('vue')`.
// - Default: 'function'
mode?: 'module' | 'function'
mode?: 'module' | 'function' | 'cjs'
// Prefix suitable identifiers with _ctx.
// If this option is false, the generated code will be wrapped in a
// `with (this) { ... }` block.