Skip to content

Commit 4d46ca7

Browse files
committed
add support for user chaining webpack main process config
1 parent 35c8a15 commit 4d46ca7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = (api, options) => {
1414
const mainProcessFile =
1515
pluginOptions.mainProcessFile ||
1616
(usesTypescript ? 'src/background.ts' : 'src/background.js')
17+
const mainProcessChain =
18+
pluginOptions.chainWebpackMainProcess || (config => config)
1719
api.registerCommand(
1820
'build:electron',
1921
{
@@ -85,7 +87,7 @@ module.exports = (api, options) => {
8587
api.resolve(outputDir + '/bundled/css/fonts')
8688
)
8789
}
88-
const bundle = webpack(mainConfig.toConfig())
90+
const bundle = webpack(mainProcessChain(mainConfig).toConfig())
8991
console.log('Bundling main process:\n')
9092
bundle.run((err, stats) => {
9193
if (err) {
@@ -169,7 +171,7 @@ module.exports = (api, options) => {
169171
.options({ transpileOnly: !mainProcessTypeChecking })
170172
}
171173

172-
const bundle = webpack(mainConfig.toConfig())
174+
const bundle = webpack(mainProcessChain(mainConfig).toConfig())
173175

174176
console.log('Bundling main process:\n')
175177
bundle.run((err, stats) => {

0 commit comments

Comments
 (0)