forked from vincentriemer/io-808
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
executable file
·85 lines (84 loc) · 1.97 KB
/
webpack.config.dev.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
var path = require("path");
var webpack = require("webpack");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
var OfflinePlugin = require("offline-plugin");
var BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
module.exports = {
mode: "development",
entry: [
"core-js/es6/symbol",
"core-js/es6/reflect",
"core-js/fn/array/includes",
"./src/index",
],
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js",
publicPath: "/",
hotUpdateChunkFilename: "[id].hot-update.js",
hotUpdateMainFilename: "hot-update.json",
},
module: {
rules: [
{
test: /\.pug$/,
use: [{ loader: "pug-loader", options: {} }],
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: "css-loader", options: { importLoaders: 1 } },
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins: [require("autoprefixer")],
},
},
],
},
{
test: /\.js$/,
use: [
{
loader: "babel-loader",
options: {
include: path.join(__dirname, "src"),
},
},
],
},
{
test: /\.(otf|eot|svg|ttf|woff|woff2).*$/,
use: "url-loader?limit=8192",
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: "file-loader",
options: {},
},
],
},
],
},
plugins: [
new MiniCssExtractPlugin({}),
new HtmlWebpackPlugin({
inject: false,
cache: false,
template: "src/index.pug",
filename: "index.html",
title: "iO-808",
}),
new BundleAnalyzerPlugin(),
],
resolve: {
modules: [path.resolve(__dirname, "src"), "node_modules"],
extensions: [".js", ".json"],
},
};