-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
29 lines (28 loc) · 992 Bytes
/
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
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("./assets/bundles/"),
publicPath: "/assets/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|svg)$/i, use: [{loader: "file-loader"}]}
]
}
};