-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
37 lines (36 loc) · 993 Bytes
/
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
const { resolve } = require('path');
const webpack = require('webpack');
module.exports = {
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'dist'),
publicPath: '/'
},
context: resolve(__dirname, 'src'),
module: {
rules: [
{
test: /\.jsx?$/,
use: ['babel-loader'],
exclude: /node_modules/
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: ['file-loader?hash=sha512&digest=hex&name=assets/images/[hash].[ext]']
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: {
loader: 'file-loader',
options: {
outputPath: 'assets/fonts/'
}
}
}
]
}
};