-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
78 lines (75 loc) · 1.61 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
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
/* eslint-env node */
const HtmlWebpackPlugin = require("html-webpack-plugin")
const htmlWebpackTemplate = require("html-webpack-template")
const path = require("path")
const VueLoaderPlugin = require("vue-loader/lib/plugin")
const links = [
"https://fonts.googleapis.com/css?family=Montserrat:400,400i,500,600,700,800,900",
"https://fonts.googleapis.com/icon?family=Material+Icons",
]
const headHtmlSnippet = `
<meta name="viewport" content="width=device-width,initial-scale=1">
`
module.exports = {
entry: {
app: ["./src/index.js"]
},
output: {
path: path.join(__dirname, ".public"),
filename: "[name].bundle.[hash:8].js",
publicPath: "/"
},
resolve: {
symlinks: false
},
module: {
rules: [{
test: /\.js$/,
use: ["babel-loader"],
exclude: /(node_modules)/,
},{
test: /\.less|\.css$/,
use: [
"style-loader",
"css-loader",
"less-loader"
]
},{
test: /\.vue$/,
loader: "vue-loader"
},{
test: /\.(png|jpg|gif)$/,
use: [{
loader: "file-loader",
options: {}
}]
}]
},
node: {
fs: "empty"
},
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
chunks: "initial",
enforce: true
}
}
}
},
plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
template: htmlWebpackTemplate,
title: "Chris - Home",
filename: "index.html",
inject: false,
lang: "en-US",
headHtmlSnippet,
links
})
]
}