File tree Expand file tree Collapse file tree 3 files changed +19
-15
lines changed
Expand file tree Collapse file tree 3 files changed +19
-15
lines changed Original file line number Diff line number Diff line change 11const UglifyJSPlugin = require ( 'uglifyjs-webpack-plugin' )
22const webpack = require ( 'webpack' )
33const Config = require ( 'webpack-chain' )
4+ const merge = require ( 'lodash.merge' )
45
56module . exports = ( api , options ) => {
67 // If plugin options are provided in vue.config.js, those will be used. Otherwise it is empty object
@@ -163,11 +164,11 @@ module.exports = (api, options) => {
163164 . build ( {
164165 // Args parsed with yargs
165166 ...builderArgs ,
166- config : {
167- ... defaultBuildConfig ,
167+ config : merge (
168+ defaultBuildConfig ,
168169 // User-defined config overwrites defaults
169- ... userBuildConfig
170- }
170+ userBuildConfig
171+ )
171172 } )
172173 . then ( ( ) => {
173174 // handle result
@@ -290,7 +291,7 @@ module.exports = (api, options) => {
290291 if ( args . debug ) {
291292 // Do not launch electron and provide instructions on launching through debugger
292293 console . log (
293- 'Not launching electron as debug argument was passed. You must launch electron though your debugger.'
294+ '\nNot launching electron as debug argument was passed. You must launch electron though your debugger.'
294295 )
295296 console . log (
296297 `If you are using Spectron, make sure to set the IS_TEST env variable to true.`
Original file line number Diff line number Diff line change 11const execa = require ( 'execa' )
22const Application = require ( 'spectron' ) . Application
33const electronPath = require ( 'electron' )
4+ const merge = require ( 'lodash.merge' )
45const portfinder = require ( 'portfinder' )
56
67portfinder . basePort = 9515
@@ -32,18 +33,19 @@ module.exports = (options = {}) =>
3233 const url = urlMatch [ 0 ] . split ( '=' ) [ 1 ]
3334 let app
3435 if ( ! options . noSpectron ) {
35- const spectronOptions = {
36- path : electronPath ,
37- args : [ `${ outputDir } /background.js` ] ,
38- env : {
39- IS_TEST : true
36+ const spectronOptions = merge (
37+ {
38+ path : electronPath ,
39+ args : [ `${ outputDir } /background.js` ] ,
40+ env : {
41+ IS_TEST : true
42+ } ,
43+ // Make sure tests do not interfere with each other
44+ port : await portfinder . getPortPromise ( )
4045 } ,
41- // Make sure tests do not interfere with each other
42- port : await portfinder . getPortPromise ( ) ,
4346 // Apply user options
44- ...options . spectronOptions
45- }
46-
47+ options . spectronOptions
48+ )
4749 // Launch app with spectron
4850 app = new Application ( spectronOptions )
4951 if ( ! options . noStart ) {
Original file line number Diff line number Diff line change 2727 "electron-builder" : " ^20.18.0" ,
2828 "execa" : " ^0.10.0" ,
2929 "fs-extra" : " ^6.0.1" ,
30+ "lodash.merge" : " ^4.6.1" ,
3031 "spectron" : " ^3.8.0" ,
3132 "uglifyjs-webpack-plugin" : " ^1.2.5" ,
3233 "webpack" : " ^4.12.0" ,
You can’t perform that action at this time.
0 commit comments