File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
packages/@vue/cli-ui/apollo-server/connectors Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -371,8 +371,23 @@ function installLocal (context) {
371
371
} )
372
372
currentPluginId = id
373
373
installationStep = 'install'
374
- const idAndRange = `${ id } @file:${ folder } `
375
- await installPackage ( cwd . get ( ) , getCommand ( cwd . get ( ) ) , null , idAndRange )
374
+
375
+ // Update package.json
376
+ {
377
+ const pkgFile = path . resolve ( cwd . get ( ) , 'package.json' )
378
+ const pkg = await fs . readJson ( pkgFile )
379
+ if ( ! pkg . devDependencies ) pkg . devDependencies = { }
380
+ pkg . devDependencies [ id ] = `file:${ folder } `
381
+ await fs . writeJson ( pkgFile , pkg , {
382
+ spaces : 2
383
+ } )
384
+ }
385
+
386
+ const from = path . resolve ( cwd . get ( ) , folder )
387
+ const to = path . resolve ( cwd . get ( ) , 'node_modules' , ...id . split ( '/' ) )
388
+ console . log ( 'copying from' , from , 'to' , to )
389
+ await fs . copy ( from , to )
390
+
376
391
await initPrompts ( id , context )
377
392
installationStep = 'config'
378
393
You can’t perform that action at this time.
0 commit comments