Skip to content

Commit 6c387d8

Browse files
committed
feat: it is working
1 parent 1ec547b commit 6c387d8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist
22
node_modules
3+
TODOs.md

src/style.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { RawSourceMap } from 'source-map'
44
import { formatPostcssSourceMap } from 'vite'
55
import type { ResolvedOptions } from '.'
66

7-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
87
export async function transformStyle(
98
code: string,
109
descriptor: SFCDescriptor,
@@ -22,7 +21,7 @@ export async function transformStyle(
2221
id: `data-v-${descriptor.id}`,
2322
// isProd: options.isProduction,
2423
source: code,
25-
scoped: block.scoped,
24+
scoped: !!block.scoped,
2625
...(options.cssDevSourcemap
2726
? {
2827
postcssOptions: {

src/template.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function transformTemplateInMain(
4343
ssr: boolean
4444
): string {
4545
return compile(code, descriptor, options, pluginContext, ssr)
46-
.replace(/var (render|staticRenderFns) =/, 'var _sfc_$1 =')
46+
.replace(/var (render|staticRenderFns) =/g, 'var _sfc_$1 =')
4747
.replace(/(render._withStripped)/, '_sfc_$1')
4848
}
4949

@@ -79,7 +79,7 @@ export function compile(
7979
)
8080
}
8181

82-
return transformRequireToImport(code)
82+
return transformRequireToImport(result.code)
8383
}
8484

8585
function resolveTemplateCompilerOptions(
@@ -103,7 +103,7 @@ function resolveTemplateCompilerOptions(
103103
}
104104
}
105105

106-
const transformAssetUrls = options.template?.transformAssetUrls
106+
const transformAssetUrls = options.template?.transformAssetUrls ?? true
107107
let assetUrlOptions
108108
if (options.devServer) {
109109
// during dev, inject vite base so that compiler-sfc can transform

0 commit comments

Comments
 (0)