-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (38 loc) · 1019 Bytes
/
webpack.config.js
File metadata and controls
41 lines (38 loc) · 1019 Bytes
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
41
const path = require('path');
const PathsPlugin = require('tsconfig-paths-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const mode = process.env['NODE_ENV'] == 'production' ? 'production' : 'development';
const devtool = mode == 'production' ? 'source-map' : 'inline-cheap-module-source-map';
const root = (...args) => path.resolve(__dirname, ...args);
module.exports = {
mode,
devtool,
target: 'electron-renderer',
entry: './ui/main.tsx',
output: {
path: root('build', 'ui'),
filename: 'ui.bundle.js'
},
module: {
rules: [
{
test: /\.tsx?/,
loader: 'ts-loader',
options: { configFile: root('ui', 'tsconfig.webpack.json') },
exclude: /node_modules/
},
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
plugins: [ new PathsPlugin() ]
},
plugins: [
new CopyPlugin({
patterns: [
{ from: './ui/html', to: 'html' },
{ from: './ui/styles', to: 'styles' }
]
})
]
};