Skip to content

Commit

Permalink
feat(compiler-sfc): add ssr option
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 16, 2020
1 parent 38f0269 commit 3b2d236
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/compiler-sfc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@vue/shared": "3.0.0-alpha.8",
"@vue/compiler-core": "3.0.0-alpha.8",
"@vue/compiler-dom": "3.0.0-alpha.8",
"@vue/compiler-ssr": "3.0.0-alpha.8",
"consolidate": "^0.15.1",
"hash-sum": "^2.0.0",
"lru-cache": "^5.1.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/compiler-sfc/src/compileTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface SFCTemplateCompileResults {
export interface SFCTemplateCompileOptions {
source: string
filename: string
ssr?: boolean
inMap?: RawSourceMap
compiler?: TemplateCompiler
compilerOptions?: CompilerOptions
Expand Down Expand Up @@ -106,7 +107,8 @@ function doCompileTemplate({
filename,
inMap,
source,
compiler = require('@vue/compiler-dom'),
ssr = false,
compiler = ssr ? require('@vue/compiler-ssr') : require('@vue/compiler-dom'),
compilerOptions = {},
transformAssetUrls
}: SFCTemplateCompileOptions): SFCTemplateCompileResults {
Expand Down

0 comments on commit 3b2d236

Please sign in to comment.