forked from Technigo/project-github-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (41 loc) · 1.01 KB
/
webpack.config.js
File metadata and controls
42 lines (41 loc) · 1.01 KB
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
const Dotenv = require("dotenv-webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const LinkTypePlugin =
require("html-webpack-link-type-plugin").HtmlWebpackLinkTypePlugin;
module.exports = {
entry: "./script.js",
output: { path: path.join(__dirname, "build"), filename: "index.bundle.js" },
mode: process.env.NODE_ENV || "development",
resolve: {
extensions: [".js"],
},
// devServer: { contentBase: __dirname },
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: ["babel-loader"],
},
{
test: /\.css$/,
exclude: /stylesheets|node_modules/,
use: ["style-loader", "css-loader"],
},
{
test: /\.(jpg|jpeg|png|gif|mp3|svg)$/,
use: ["file-loader"],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, "index.html"),
}),
new LinkTypePlugin({
"*.css": "text/css",
}),
new Dotenv(),
],
};