File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,23 @@ export class ReplStore implements Store {
168
168
}
169
169
170
170
serialize ( ) {
171
- return '#' + utoa ( JSON . stringify ( this . getFiles ( ) ) )
171
+ const files = this . getFiles ( )
172
+ const importMap = files [ 'import-map.json' ]
173
+ if ( importMap ) {
174
+ const { imports } = JSON . parse ( importMap )
175
+ if ( imports [ 'vue' ] === this . defaultVueRuntimeURL ) {
176
+ delete imports [ 'vue' ]
177
+ }
178
+ if ( imports [ 'vue/server-renderer' ] === this . defaultVueServerRendererURL ) {
179
+ delete imports [ 'vue/server-renderer' ]
180
+ }
181
+ if ( ! Object . keys ( imports ) . length ) {
182
+ delete files [ 'import-map.json' ]
183
+ } else {
184
+ files [ 'import-map.json' ] = JSON . stringify ( { imports } , null , 2 )
185
+ }
186
+ }
187
+ return '#' + utoa ( JSON . stringify ( files ) )
172
188
}
173
189
174
190
getFiles ( ) {
@@ -209,7 +225,8 @@ export class ReplStore implements Store {
209
225
JSON . stringify (
210
226
{
211
227
imports : {
212
- vue : this . defaultVueRuntimeURL
228
+ vue : this . defaultVueRuntimeURL ,
229
+ 'vue/server-renderer' : this . defaultVueServerRendererURL
213
230
}
214
231
} ,
215
232
null ,
You can’t perform that action at this time.
0 commit comments