forked from shakacode/react-webpack-rails-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.hot.config.js
44 lines (36 loc) · 1.45 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
42
43
44
// Run like this:
// cd client && node server.js
'use strict';
var path = require('path');
var config = require('./webpack.common.config');
var 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:3000',
'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;