forked from faressoft/terminalizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (43 loc) · 1.03 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
const webpack = require('webpack');
const path = require('path');
// Extract CSS into separate files
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
// Global variables
const globals = {
$: 'jquery',
jQuery: 'jquery',
Terminal: ['xterm', 'Terminal'],
'window.jQuery': 'jquery',
'window.$': 'jquery'
};
module.exports = {
mode: 'production',
target: 'electron-renderer',
entry: {
app: './render/src/js/app.js'
},
output: {
filename: 'js/[name].js',
path: path.resolve(__dirname, 'render/dist'),
publicPath: '/dist/'
},
plugins: [
new CleanWebpackPlugin(['./render/dist'], {verbose: false}),
new webpack.ProvidePlugin(globals),
new MiniCssExtractPlugin({filename: 'css/[name].css'}),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
rules: [
// CSS
{
test: /\.css$/,
use: [
{loader: MiniCssExtractPlugin.loader},
{loader: 'css-loader'}
],
}
]
}
};