generated from dhmit/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
39 lines (37 loc) · 1.21 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
const path = require("path");
const BundleTracker = require("webpack-bundle-tracker");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const ESLintPlugin = require("eslint-webpack-plugin");
module.exports = {
context: __dirname,
entry: {
index: "./frontend/index"
},
output: {
path: path.resolve("./build/bundles/"),
publicPath: "/static/bundles/",
filename: "[name].bundle.js"
},
plugins: [
new BundleTracker({filename: "./webpack-stats.json"}),
new MiniCssExtractPlugin({filename: "[name].bundle.css"}),
new ESLintPlugin(),
],
module: {
rules: [
// eslint-disable-next-line max-len
{
test: /\.(scss|css)$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
},
{test: /\.js|.jsx$/, exclude: /node_modules/, use: "babel-loader"},
{test: /\.(png|jpe?g|gif)$/i, use: [{loader: "file-loader"}]},
{
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
},
{test: /\.(woff|woff2|eot|ttf)$/, use: "url-loader"}
]
}
};