-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (53 loc) · 1.65 KB
/
webpack.config.js
File metadata and controls
54 lines (53 loc) · 1.65 KB
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
const path = require('path')
const webpack = require('webpack')
module.exports = {
devtool: 'inline-source-map',
context: path.resolve(__dirname, './app'),
entry: ['webpack-hot-middleware/client?timeout=20000&reload=true',
'./index.js'],
output: {
path: path.resolve(__dirname, './public'),
filename: 'bundle.js',
publicPath: '/'
// publicPath: path.resolve(__dirname, './public')
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
rules: [
{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: { presets: ['es2015', 'react', 'stage-2']}
}]
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(sass|scss)$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.(woff|woff2|eot|ttf|svg)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=100000?name=/fonts/[ext]/[name].[ext]'
},
{
test: /\.(jpe?g|png|gif|ico)$/i,
loader: "file-loader?name=/images/[ext]/[name].[ext]"
},
// {
// test: /\.(ttf|eot|svg|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
// loader: "file-loader?name=/fonts/[ext]/[name].[ext]"
// }
]
}
}