forked from FlashpointProject/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
40 lines (39 loc) · 1.1 KB
/
webpack.config.js
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 TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
entry: {
main: './src/renderer/index.tsx',
logger: './src/renderer/logger.tsx'
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, './build/window')
},
// Allows importing build-in node modules in electron render.
// https://stackoverflow.com/questions/39417628/how-to-reference-node-fs-api-with-electron-in-typescript
target: 'electron-renderer',
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
plugins: [new TsconfigPathsPlugin({ configFile: './tsconfig.json' })]
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /(node_modules)/,
use: {
loader: 'swc-loader',
options: {
parseMap: true
}
}
}
]
},
devtool: 'eval-source-map', // TODO: Put in Development config
externals: {
fsevents: 'require(\'fsevents\')',
'react-native-sqlite-storage': 'react-native-sqlite-storage'
// archiver: 'require(\'archiver\')'
}
};