-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.config.js
36 lines (32 loc) · 971 Bytes
/
webpack.prod.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
/* eslint-disable import/no-extraneous-dependencies */
const webpack = require('webpack');
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: ['@babel/polyfill', './src/app/App.js'],
mode: 'production',
target: 'electron-main',
output: {
path: path.join(__dirname, '/public/built'),
filename: 'bundle.js',
publicPath: '/built/',
},
module: {
rules: [
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000',
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.ExternalsPlugin('commonjs', ['node-pty', 'chokidar']),
],
optimization: {
minimizer: [new TerserPlugin()],
},
};