forked from Cal-CS-61A-Staff/61a-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.size.config.js
59 lines (57 loc) · 1.71 KB
/
webpack.size.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
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
module.exports = {
entry: "./src/renderer/index.js",
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist/web"),
// publicPath: "dist/web",
},
devtool: "inline-source-map",
devServer: {
contentBase: ".",
},
module: {
noParse: /monaco-editor\/min\/vs\/loader\.js|jquery\.jsPlumb-1\.3\.10-all-min\.js/,
rules: [
{
test: /.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/,
query: {
presets: ["@babel/react"],
},
},
{
test: /\.css$/,
use: [{ loader: "style-loader" }, { loader: "css-loader" }],
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif)(\?\S*)?$/,
loader: "url-loader",
},
],
},
plugins: [
new HtmlWebpackPlugin(),
new webpack.DefinePlugin({
ELECTRON: false,
__static: JSON.stringify("./dist/web/static"),
}),
new MonacoWebpackPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
jquery: "jquery",
}),
new CopyWebpackPlugin([{
from: "static",
to: "static",
}]),
new BundleAnalyzerPlugin(),
],
};