-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
webpack.config.js
70 lines (67 loc) · 1.81 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
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
module.exports = {
entry: "./src/index.js",
output: {
filename: "main.js",
path: path.resolve(__dirname, "build"),
},
devtool: "source-map",
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, "public", "index.html"),
}),
sentryWebpackPlugin({
org: "viv-ip",
project: "frontend-tutorial",
// Auth tokens can be obtained by creating an internal integration
// at https://<organization_id>.sentry.io/settings/developer-settings/
// and need "Release: Admin" and "Organization: Read & Write" permissions
authToken: process.env.SENTRY_AUTH_TOKEN,
// Enable automatically creating releases and associating commits
release: {
create: true,
setCommits: {
auto: true,
},
},
}),
],
devServer: {
static: {
directory: path.join(__dirname, "build"),
},
port: 3000,
},
module: {
// exclude node_modules
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ["babel-loader"],
},
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
type: "asset",
parser: {
dataUrlCondition: {
// maxSize: 10000,
},
},
},
{
test: /\.(css)$/,
use: ["style-loader", "css-loader"],
},
],
},
// pass all js files through Babel
resolve: {
extensions: ["*", ".js", ".jsx"],
},
};