forked from Zoapp/react-materialcomponents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
51 lines (49 loc) · 1.23 KB
/
webpack.dev.js
File metadata and controls
51 lines (49 loc) · 1.23 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
const merge = require("webpack-merge");
const commonConfig = require("./webpack.common.js");
const path = require("path");
const webpack = require("webpack");
// const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = merge(commonConfig, {
entry: [
"react-hot-loader/patch",
"webpack-dev-server/client?http://localhost:3032",
"webpack/hot/only-dev-server",
"./demos/index.jsx"
],
devtool: "inline-source-map",
devServer: {
hot: true,
contentBase: path.resolve(__dirname, "./dist/public"),
port: 3032,
host: "localhost",
publicPath: "/",
historyApiFallback: true,
},
module: {
loaders: [
{ test: /\.(jpe?g|png|gif|svg|eot|woff|ttf|svg|woff2)$/, loader: "file?name=[name].[ext]" }
],
rules: [
{
test: /\.jsx?$/,
use: ["babel-loader",],
exclude: /node_modules/
},
{
test: /\.css$/,
use: ["style-loader", "css-loader?modules",],
},
{
test: /\.(ttf|eot|woff|woff2)$/,
loader: "file-loader",
options: {
name: "fonts/[name].[ext]",
},
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
]
});