@@ -45,7 +45,7 @@ import {
45
45
/**
46
46
* the version of the library
47
47
*/
48
- import { version } from './index'
48
+ import { version , vueVersion } from './index'
49
49
50
50
// @ts -ignore
51
51
const targetBrowserBabelPluginsHash : string = hash ( ...Object . keys ( { ...( typeof ___targetBrowserBabelPlugins !== 'undefined' ? ___targetBrowserBabelPlugins : { } ) } ) ) ;
@@ -94,8 +94,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
94
94
95
95
const customBlockCallbacks : ( CustomBlockCallback | undefined ) [ ] = customBlockHandler !== undefined ? await Promise . all ( descriptor . customBlocks . map ( ( block ) => customBlockHandler ( block , filename , options ) ) ) : [ ] ;
96
96
97
- const componentHash = hash ( strFilename , version , targetBrowserBabelPluginsHash ) ;
98
- const scopeId = `data-v-${ componentHash } ` ;
97
+ const scopeId = `data-v-${ hash ( strFilename ) } ` ;
99
98
100
99
// hack: asynchronously preloads the language processor before it is required by the synchronous preprocessCustomRequire() callback, see below
101
100
if ( descriptor . template && descriptor . template . lang )
@@ -132,7 +131,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
132
131
await withCache (
133
132
compiledCache ,
134
133
[
135
- componentHash ,
134
+ vueVersion ,
136
135
compileTemplateOptions . source ,
137
136
descriptor . template . lang ,
138
137
] ,
@@ -161,11 +160,14 @@ export async function createSFCModule(source : string, filename : AbstractPath,
161
160
await withCache (
162
161
compiledCache ,
163
162
[
164
- componentHash ,
163
+ vueVersion ,
164
+ isProd ,
165
+ devMode ,
165
166
src ,
166
167
descriptor . script . lang ,
167
168
additionalBabelParserPlugins ,
168
169
Object . keys ( additionalBabelPlugins ) ,
170
+ targetBrowserBabelPluginsHash ,
169
171
] ,
170
172
async ( { preventCache } ) => {
171
173
@@ -192,8 +194,15 @@ export async function createSFCModule(source : string, filename : AbstractPath,
192
194
await withCache (
193
195
compiledCache ,
194
196
[
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 ,
197
206
] ,
198
207
async ( { preventCache } ) => {
199
208
@@ -244,10 +253,12 @@ export async function createSFCModule(source : string, filename : AbstractPath,
244
253
const style = await withCache (
245
254
compiledCache ,
246
255
[
247
- componentHash ,
256
+ vueVersion ,
248
257
srcRaw ,
249
- descStyle . lang
250
- ] ,
258
+ descStyle . lang ,
259
+ scopeId ,
260
+ descStyle . scoped ,
261
+ ] ,
251
262
async ( { preventCache } ) => {
252
263
253
264
const src = processStyles !== undefined ? await processStyles ( srcRaw , descStyle . lang , filename , options ) : srcRaw ;
0 commit comments