forked from getstation/desktop-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.webui.js
51 lines (42 loc) · 1.22 KB
/
webpack.config.webui.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
/**
* webui compoments can't be build through electron-webpack yet because it doesn't support `target: 'web'`.
* So we have to build it manually.
*/
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const WriteFilePlugin = require('write-file-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseConfig = require('./webpack.config.base');
module.exports = (env, argv) => merge.smart(baseConfig(env, argv), {
target: 'web',
node: {
global: true,
__dirname: 'mock',
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['multiInstanceConfiguration'],
filename: 'multi-instance-configuration.html',
template: './app/app-sub.html',
}),
new webpack.NamedModulesPlugin(),
new WriteFilePlugin(),
],
entry: {
multiInstanceConfiguration: './app/applications/multi-instance-configuration/webui/index.tsx',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.graphql', '.svg']
},
externals: [
{
fs: '{ join: () => {} }',
},
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist', 'renderer'),
chunkFilename: '[name].bundle.js',
},
});