Created
September 3, 2022 15:42
-
-
Save jochy/ff60e598f743e76efa30d7267d0cc373 to your computer and use it in GitHub Desktop.
Electron webpack and nodegit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const {ModifySourcePlugin} = require('modify-source-webpack-plugin'); | |
const {ModificationType} = require("modify-source-webpack-plugin/build/ModifySourcePlugin"); | |
module.exports = { | |
mode: 'production', | |
entry: { | |
main: './main.js', | |
}, | |
resolve: { | |
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'], | |
}, | |
plugins: [ | |
new ModifySourcePlugin({ | |
rules: [{ | |
test: /nodegit\.js$/, | |
modifications: [{ | |
type: ModificationType.REPLACE_ALL, | |
searchValue: '../build/Debug/nodegit.node', | |
replaceValue: '../build/Release/nodegit.node' | |
}] | |
}] | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment