Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit d70f594

Browse files
committed
feat: support for new sfc experimental features
- new `<script setup>` vuejs/rfcs#227 - new `<style>` variable injection vuejs/rfcs#231 Requires a version of `@vue/compiler-sfc` that supports the above features.
1 parent df98a00 commit d70f594

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/script.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function resolveScript(
3838
if (compileScript) {
3939
try {
4040
resolved = compileScript(descriptor, {
41+
// @ts-ignore
4142
id: scopeId,
4243
isProd,
4344
inlineTemplate: true,

src/style.ts

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export async function transformStyle(
4949
const result = await compileStyleAsync({
5050
filename: query.filename,
5151
id: `data-v-${query.id}`,
52+
// @ts-ignore
5253
isProd: isProduction,
5354
source: code,
5455
scoped: block.scoped,

src/template.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export function transformTemplate(
2121
const descriptor = getDescriptor(query.filename)
2222
const result = compileTemplate({
2323
...getTemplateCompilerOptions(options, descriptor, query.id),
24-
id: query.id,
2524
source: code,
2625
filename: query.filename,
2726
})
@@ -73,6 +72,7 @@ export function getTemplateCompilerOptions(
7372
options.templatePreprocessOptions[preprocessLang]
7473
const resolvedScript = getResolvedScript(descriptor, isServer)
7574
return {
75+
// @ts-ignore
7676
id: scopeId,
7777
scoped: hasScoped,
7878
isProd,
@@ -83,6 +83,7 @@ export function getTemplateCompilerOptions(
8383
preprocessCustomRequire: options.preprocessCustomRequire,
8484
compiler: options.compiler,
8585
ssr: isServer,
86+
// @ts-ignore
8687
ssrCssVars: descriptor.cssVars,
8788
compilerOptions: {
8889
...options.compilerOptions,

0 commit comments

Comments
 (0)