wip: new cssVars SSR integration + fix cssVars SSR injection for suspense
This commit is contained in:
@@ -22,6 +22,7 @@ import { isObject } from '@vue/shared'
|
||||
import * as CompilerDOM from '@vue/compiler-dom'
|
||||
import * as CompilerSSR from '@vue/compiler-ssr'
|
||||
import consolidate from 'consolidate'
|
||||
import { warnOnce } from './warn'
|
||||
|
||||
export interface TemplateCompiler {
|
||||
compile(template: string, options: CompilerOptions): CodegenResult
|
||||
@@ -170,6 +171,14 @@ function doCompileTemplate({
|
||||
nodeTransforms = [transformAssetUrl, transformSrcset]
|
||||
}
|
||||
|
||||
if (ssr && !compilerOptions.ssrCssVars) {
|
||||
warnOnce(
|
||||
`compileTemplate is called with \`ssr: true\` but no ` +
|
||||
`corresponding \`ssrCssVars\` option. The value can be generated by ` +
|
||||
`calling \`generateCssVars(sfcDescriptor, scopeId, isProduction)\`.`
|
||||
)
|
||||
}
|
||||
|
||||
let { code, ast, preamble, map } = compiler.compile(source, {
|
||||
mode: 'module',
|
||||
prefixIdentifiers: true,
|
||||
|
||||
Reference in New Issue
Block a user