-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
42 lines (39 loc) · 1.22 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
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
main: ["@babel/polyfill", path.resolve(__dirname, './src/index.js')],
vendor: ["@babel/polyfill", path.resolve(__dirname, './src/vendor.js')],
home_search: ["@babel/polyfill", path.resolve(__dirname, './src/home_search.js')],
create_item_form: ["@babel/polyfill", path.resolve(__dirname, './src/create_item.js')],
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html'
})
],
module: {
rules: [
{
test: /\.html$/,
use: ['html-loader']
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
//test: /\.(svg|png|jpg|gif)$/,
test: /\.(jpe|jpg|woff|woff2|eot|ttf|svg)(\?.*$|$)/,
use: {
loader: 'file-loader',
options: {
name: "[name].[hash].[ext]",
outputPath: 'imgs'
}
}
}
],
},
}