-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
68 lines (66 loc) · 1.58 KB
/
webpack.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
// testing.webpack.js
"use strict";
// Depends
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
cache: true,
entry: "./src/main.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist")
},
mode: "development",
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader",
exclude: path.resolve(__dirname, "node_modules")
},
{
test: /\.css$/,
use: [{ loader: "style-loader" }, { loader: "css-loader" }]
},
{
test: /\.less$/,
use: ["vue-style-loader", "css-loader", "less-loader"]
},
{
test: /\.jpe?g$|\.gif$|\.png$/i,
loader: "file-loader?name=[name].[hash].[ext]"
},
{
test: /\.(woff|woff2|eot|ttf|svg)(\?.*$|$)/,
loader: "file-loader?name=[name].[ext]?[hash]"
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
filename: "index.html",
template: "index.html",
inject: true
}),
new MiniCssExtractPlugin({
filename: "style.css"
})
],
devServer: {
contentBase: path.join(__dirname, "dist"),
port: 8080,
host: "127.0.0.1",
open: true,
inline: true,
hot: true,
noInfo: false,
quiet: false,
stats: "errors-only"
},
devtool: "#cheap-module-eval-source-map"
};