Files
wagyu-installer-eth-stake/webpack.electron.config.js
Rémy Roy b2e17ef176 Rebase on keygen code (#76)
* Initial rebase with Key Gen code

* Clean up Ken Gen code for installer

* Remove build folder in .gitignore

* Fixed gitignore

* Fix gitignore issue

* Use installer brand for icons
2022-01-19 21:35:40 -05:00

62 lines
1.6 KiB
JavaScript

'use strict';
const path = require('path');
const webpack = require('webpack');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin({
branch: true,
commithashCommand: 'rev-list --max-count=1 --no-merges --abbrev-commit HEAD',
});
module.exports = [
{
mode: 'development',
entry: './src/electron/index.ts',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'build/electron')
},
module: {
rules: [
{ test: /\.tsx?$/, loader: 'ts-loader' }
]
},
plugins: [
gitRevisionPlugin,
new webpack.DefinePlugin({
VERSION: JSON.stringify(gitRevisionPlugin.version()),
COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()),
BRANCH: JSON.stringify(gitRevisionPlugin.branch()),
LASTCOMMITDATETIME: JSON.stringify(gitRevisionPlugin.lastcommitdatetime()),
})
],
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
// tell webpack that we're building for electron
target: 'electron-main',
node: {
// tell webpack that we actually want a working __dirname value
// (ref: https://webpack.js.org/configuration/node/#node-__dirname)
__dirname: false
}
},
{
mode: 'development',
entry: './src/electron/preload.ts',
output: {
filename: 'preload.js',
path: path.resolve(__dirname, 'build/electron')
},
module: {
rules: [
{ test: /\.tsx?$/, loader: 'ts-loader' }
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
target: 'electron-preload'
}
];