-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
40 lines (36 loc) · 1.22 KB
/
webpack.config.js
File metadata and controls
40 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const path = require('path');
const packageJson = require('./package.json');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const setupFilename = packageJson.name + ' Setup ' + packageJson.version + '.exe';
console.log("##teamcity[setParameter name='setupFilename' value='" + setupFilename + "']");
module.exports = (env, argv) => {
const devMode = argv.mode === 'development';
console.log({mode: argv.mode});
return {
mode: argv.mode,
entry: {
main: './src/main-process/main-window.ts',
renderer: './src/renderer/renderer.ts',
},
output: {
path: path.join(__dirname, 'distr/'),
filename: '[name].js',
},
target: 'electron-renderer',
node: false,
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'],
},
module: {
rules: [
{test: /\.tsx?$/, loader: 'ts-loader', options: {silent: true}},
{
test: /\.css$/,
use: [devMode ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader'],
},
],
},
plugins: [new MiniCssExtractPlugin({filename: '[name].css'})],
devtool: devMode ? 'eval-cheap-module-source-map' : undefined,
};
};