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 1
1
const UglifyJSPlugin = require ( 'uglifyjs-webpack-plugin' )
2
2
const webpack = require ( 'webpack' )
3
3
const Config = require ( 'webpack-chain' )
4
+ const merge = require ( 'lodash.merge' )
4
5
5
6
module . exports = ( api , options ) => {
6
7
// 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) => {
163
164
. build ( {
164
165
// Args parsed with yargs
165
166
...builderArgs ,
166
- config : {
167
- ... defaultBuildConfig ,
167
+ config : merge (
168
+ defaultBuildConfig ,
168
169
// User-defined config overwrites defaults
169
- ... userBuildConfig
170
- }
170
+ userBuildConfig
171
+ )
171
172
} )
172
173
. then ( ( ) => {
173
174
// handle result
@@ -290,7 +291,7 @@ module.exports = (api, options) => {
290
291
if ( args . debug ) {
291
292
// Do not launch electron and provide instructions on launching through debugger
292
293
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.'
294
295
)
295
296
console . log (
296
297
`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 1
1
const execa = require ( 'execa' )
2
2
const Application = require ( 'spectron' ) . Application
3
3
const electronPath = require ( 'electron' )
4
+ const merge = require ( 'lodash.merge' )
4
5
const portfinder = require ( 'portfinder' )
5
6
6
7
portfinder . basePort = 9515
@@ -32,18 +33,19 @@ module.exports = (options = {}) =>
32
33
const url = urlMatch [ 0 ] . split ( '=' ) [ 1 ]
33
34
let app
34
35
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 ( )
40
45
} ,
41
- // Make sure tests do not interfere with each other
42
- port : await portfinder . getPortPromise ( ) ,
43
46
// Apply user options
44
- ...options . spectronOptions
45
- }
46
-
47
+ options . spectronOptions
48
+ )
47
49
// Launch app with spectron
48
50
app = new Application ( spectronOptions )
49
51
if ( ! options . noStart ) {
Original file line number Diff line number Diff line change 27
27
"electron-builder" : " ^20.18.0" ,
28
28
"execa" : " ^0.10.0" ,
29
29
"fs-extra" : " ^6.0.1" ,
30
+ "lodash.merge" : " ^4.6.1" ,
30
31
"spectron" : " ^3.8.0" ,
31
32
"uglifyjs-webpack-plugin" : " ^1.2.5" ,
32
33
"webpack" : " ^4.12.0" ,
You can’t perform that action at this time.
0 commit comments