/
webpack.hot.config.js
41 lines (34 loc) · 1.4 KB
/
webpack.hot.config.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
const path = require("path");
const config = require("./webpack.common.config");
const webpack = require("webpack");
// We're using the bootstrap-sass loader.
// See: https://github.com/justin808/bootstrap-sass-loader
config.entry.push("webpack-dev-server/client?http://localhost:4444",
"webpack/hot/dev-server"
// "./scripts/webpack_only"
// custom bootstrap
// "bootstrap-sass!./bootstrap-sass.config.js"
);
config.output = {
// this file is served directly by webpack
filename: "express-bundle.js",
path: __dirname
};
config.plugins = [new webpack.HotModuleReplacementPlugin()];
config.devtool = "eval-source-map";
// All the styling loaders only apply to hot-reload, not rails
config.module.loaders.push(
{test: /\.jsx?$/, loaders: ["react-hot", "babel"], exclude: /node_modules/},
{test: /\.css$/, loader: "style-loader!css-loader"},
{
test: /\.scss$/,
loader: "style!css!sass?outputStyle=expanded&imagePath=/assets/images&includePaths[]=" +
path.resolve(__dirname, "./assets/stylesheets")
},
// The url-loader uses DataUrls. The file-loader emits files.
{test: /\.woff$/, loader: "url-loader?limit=10000&minetype=application/font-woff"},
{test: /\.woff2$/, loader: "url-loader?limit=10000&minetype=application/font-woff"},
{test: /\.ttf$/, loader: "file-loader"},
{test: /\.eot$/, loader: "file-loader"},
{test: /\.svg$/, loader: "file-loader"});
module.exports = config;