@@ -6,13 +6,13 @@ module.exports = (api, options) => {
6
6
options . pluginOptions && options . pluginOptions . electronBuilder
7
7
? options . pluginOptions . electronBuilder
8
8
: { }
9
- const usesTypescript = pluginOptions . disableBackgroundTypescript
9
+ const usesTypescript = pluginOptions . disableMainProcessTypescript
10
10
? false
11
11
: api . hasPlugin ( 'typescript' )
12
- const backgroundTypeChecking = pluginOptions . backgroundTypeChecking || false
12
+ const mainProcessTypeChecking = pluginOptions . mainProcessTypeChecking || false
13
13
const outputDir = pluginOptions . outputDir || 'dist_electron'
14
- const backgroundFile =
15
- pluginOptions . backgroundFile ||
14
+ const mainProcessFile =
15
+ pluginOptions . mainProcessFile ||
16
16
( usesTypescript ? 'src/background.ts' : 'src/background.js' )
17
17
api . registerCommand (
18
18
'build:electron' ,
@@ -59,15 +59,15 @@ module.exports = (api, options) => {
59
59
mainConfig
60
60
. plugin ( 'env' )
61
61
. use ( webpack . EnvironmentPlugin , [ { NODE_ENV : 'production' } ] )
62
- mainConfig . entry ( 'background' ) . add ( api . resolve ( backgroundFile ) )
62
+ mainConfig . entry ( 'background' ) . add ( api . resolve ( mainProcessFile ) )
63
63
if ( usesTypescript ) {
64
64
mainConfig . resolve . extensions . merge ( [ '.ts' ] )
65
65
mainConfig . module
66
66
. rule ( 'ts' )
67
67
. test ( / \. t s $ / )
68
68
. use ( 'ts-loader' )
69
69
. loader ( 'ts-loader' )
70
- . options ( { transpileOnly : ! backgroundTypeChecking } )
70
+ . options ( { transpileOnly : ! mainProcessTypeChecking } )
71
71
}
72
72
73
73
console . log ( 'Bundling render process:' )
@@ -158,15 +158,15 @@ module.exports = (api, options) => {
158
158
mainConfig
159
159
. plugin ( 'env' )
160
160
. use ( webpack . EnvironmentPlugin , [ { NODE_ENV : 'development' } ] )
161
- mainConfig . entry ( 'background' ) . add ( api . resolve ( backgroundFile ) )
161
+ mainConfig . entry ( 'background' ) . add ( api . resolve ( mainProcessFile ) )
162
162
if ( usesTypescript ) {
163
163
mainConfig . resolve . extensions . merge ( [ '.ts' ] )
164
164
mainConfig . module
165
165
. rule ( 'ts' )
166
166
. test ( / \. t s $ / )
167
167
. use ( 'ts-loader' )
168
168
. loader ( 'ts-loader' )
169
- . options ( { transpileOnly : ! backgroundTypeChecking } )
169
+ . options ( { transpileOnly : ! mainProcessTypeChecking } )
170
170
}
171
171
172
172
const bundle = webpack ( mainConfig . toConfig ( ) )
0 commit comments