-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
42 lines (41 loc) · 1.24 KB
/
webpack.common.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
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
vendor: './src/vendor.js',
main: './src/index.js'
},
plugins: [
new HtmlWebpackPlugin({ // Html bundle plugin
template: './src/index.html',
favicon: "./src/icon.png"
})
],
module: {
rules: [
{
test: /\.html$/i,
use: ['html-loader'], // Linked file load to the html
},
{
test: /\.(png|jpe?g|gif)$/i,
use: {
loader: "file-loader", // Linked file load to the 'dist' folder
options: {
name: "[name].[hash].[ext]",
outputPath: "imgs" // Path
}
}
},
{
test: /\.(svg|eot|woff|woff2|ttf)$/i,
use: {
loader: "file-loader", // Font file move to the 'dist' folder
options: {
name: "[name].[ext]",
outputPath: "fonts" // Path
}
}
}
],
}
}