-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdev.config.js
More file actions
68 lines (59 loc) · 1.56 KB
/
dev.config.js
File metadata and controls
68 lines (59 loc) · 1.56 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* jslint node: true */
"use strict";
var Webpack = require('webpack');
var path = require('path');
var nodeModulesPath = path.resolve('node_modules');
var buildPath = path.resolve('web/assets');
var config = {
devtool: 'eval',
entry: {
frontend: ['./src/js/frontend.js', 'webpack/hot/dev-server']
},
output: {
path: buildPath,
filename: '[name].js',
publicPath: '/assets'
},
devServer: {
contentBase: "./assets",
noInfo: true,
hot: true,
inline: true
},
module: {
rules: [
{
test: /.*\.jsx?$/,
exclude: /node_modules/,
use: [
{ loader: 'react-hot-loader/webpack' },
{
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
'@babel/preset-env',
'@babel/preset-react'
]
}
}
]
},
{ test: /app\/.*\.json$/, loader: 'json-loader' },
// Styles
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.less$/, loader: "style!css?localIdentName=[path][name]---[local]---[hash:base64:5]!postcss!less" },
// Fonts
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
]
},
resolve: {
extensions: ['.js', '.jsx']
},
plugins: [
new Webpack.HotModuleReplacementPlugin(),
new Webpack.NoEmitOnErrorsPlugin()
]
};
module.exports = config;