@@ -45,7 +45,7 @@ import {
4545/**
4646 * the version of the library
4747 */
48- import { version } from './index'
48+ import { version , vueVersion } from './index'
4949
5050// @ts -ignore
5151const targetBrowserBabelPluginsHash : string = hash ( ...Object . keys ( { ...( typeof ___targetBrowserBabelPlugins !== 'undefined' ? ___targetBrowserBabelPlugins : { } ) } ) ) ;
@@ -94,8 +94,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
9494
9595 const customBlockCallbacks : ( CustomBlockCallback | undefined ) [ ] = customBlockHandler !== undefined ? await Promise . all ( descriptor . customBlocks . map ( ( block ) => customBlockHandler ( block , filename , options ) ) ) : [ ] ;
9696
97- const componentHash = hash ( strFilename , version , targetBrowserBabelPluginsHash ) ;
98- const scopeId = `data-v-${ componentHash } ` ;
97+ const scopeId = `data-v-${ hash ( strFilename ) } ` ;
9998
10099 // hack: asynchronously preloads the language processor before it is required by the synchronous preprocessCustomRequire() callback, see below
101100 if ( descriptor . template && descriptor . template . lang )
@@ -132,7 +131,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
132131 await withCache (
133132 compiledCache ,
134133 [
135- componentHash ,
134+ vueVersion ,
136135 compileTemplateOptions . source ,
137136 descriptor . template . lang ,
138137 ] ,
@@ -161,11 +160,14 @@ export async function createSFCModule(source : string, filename : AbstractPath,
161160 await withCache (
162161 compiledCache ,
163162 [
164- componentHash ,
163+ vueVersion ,
164+ isProd ,
165+ devMode ,
165166 src ,
166167 descriptor . script . lang ,
167168 additionalBabelParserPlugins ,
168169 Object . keys ( additionalBabelPlugins ) ,
170+ targetBrowserBabelPluginsHash ,
169171 ] ,
170172 async ( { preventCache } ) => {
171173
@@ -192,8 +194,15 @@ export async function createSFCModule(source : string, filename : AbstractPath,
192194 await withCache (
193195 compiledCache ,
194196 [
195- componentHash ,
196- compileTemplateOptions . source
197+ vueVersion ,
198+ devMode ,
199+ compileTemplateOptions . source ,
200+ delimiters ,
201+ whitespace ,
202+ scopeId ,
203+ additionalBabelParserPlugins ,
204+ Object . keys ( additionalBabelPlugins ) ,
205+ targetBrowserBabelPluginsHash ,
197206 ] ,
198207 async ( { preventCache } ) => {
199208
@@ -244,10 +253,12 @@ export async function createSFCModule(source : string, filename : AbstractPath,
244253 const style = await withCache (
245254 compiledCache ,
246255 [
247- componentHash ,
256+ vueVersion ,
248257 srcRaw ,
249- descStyle . lang
250- ] ,
258+ descStyle . lang ,
259+ scopeId ,
260+ descStyle . scoped ,
261+ ] ,
251262 async ( { preventCache } ) => {
252263
253264 const src = processStyles !== undefined ? await processStyles ( srcRaw , descStyle . lang , filename , options ) : srcRaw ;
0 commit comments