This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
forked from PeculiarVentures/fortify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
86 lines (84 loc) · 2.59 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: "none",
entry: {
main: path.join(__dirname, './src/main/main.ts'),
// windows
keys: path.join(__dirname, './src/renderer/forms/keys/index.tsx'),
about: path.join(__dirname, './src/renderer/forms/about/index.tsx'),
'key-pin': path.join(__dirname, './src/renderer/forms/key-pin/index.tsx'),
'p11-pin': path.join(__dirname, './src/renderer/forms/p11-pin/index.tsx'),
message: path.join(__dirname, './src/renderer/forms/message/index.tsx'),
},
output: {
path: path.resolve(__dirname, 'out'),
filename: '[name].js',
},
// Enable sourcemaps for debugging webpack's output.
devtool: 'source-map',
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['.ts', '.tsx', '.js', '.json'],
},
plugins: [
// new webpack.optimize.UglifyJsPlugin({
// beautify: false,
// comments: false,
// sourceMap: true,
// compress: {
// sequences: true,
// booleans: true,
// loops: true,
// unused: true,
// warnings: false,
// drop_console: true,
// unsafe: true,
// },
// }),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
],
node: {
__dirname: false,
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'asn1js': 'require("asn1js")',
'child_process': 'require("child_process")',
'electron': 'require("electron")',
'fs': 'require("fs")',
'jose-jwe-jws': 'require("jose-jwe-jws")',
'node-webcrypto-ossl': 'require("node-webcrypto-ossl")',
'os': 'require("os")',
'crypto': 'require("crypto")',
'path': 'require("path")',
'pkijs': 'require("pkijs")',
'request': 'require("request")',
'semver': 'require("semver")',
'sudo-prompt': 'require("sudo-prompt")',
'url': 'require("url")',
'webcrypto-local': 'require("webcrypto-local")',
'winston': 'require("winston")',
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader' },
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
{
test: /\.sass$/,
use: [
'style-loader',
'css-loader?modules&importLoaders=1&localIdentName=[local]_[hash:base64:5]',
'sass-loader',
],
},
],
},
};