Skip to content

Instantly share code, notes, and snippets.

@jochy
Created September 3, 2022 15:42
Show Gist options
  • Save jochy/ff60e598f743e76efa30d7267d0cc373 to your computer and use it in GitHub Desktop.
Save jochy/ff60e598f743e76efa30d7267d0cc373 to your computer and use it in GitHub Desktop.
Electron webpack and nodegit
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