Created
April 28, 2015 11:27
-
-
Save iest/0c82a33c881837faa175 to your computer and use it in GitHub Desktop.
Markdown loader failing with react-hot-loader?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('hotreload', function() { | |
require('./hotLoadServer'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var webpack = require('webpack'); | |
var WebpackDevServer = require('webpack-dev-server'); | |
var config = require('./webpack.config'); | |
var host = process.env.HOT_LOAD_HOST || 'localhost'; | |
var port = process.env.HOT_LOAD_PORT || 8888; | |
new WebpackDevServer(webpack(config), { | |
contentBase: `http://${host}:8888`, | |
publicPath: config.output.publicPath, | |
hot: true, | |
}).listen(port, host, function(err) { | |
if (err) { | |
console.log(err); | |
} | |
console.log(`Hotloader listening at ${host}:${port}`); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webpack from 'webpack'; | |
const host = process.env.HOT_LOAD_HOST || 'localhost'; | |
const port = process.env.HOT_LOAD_PORT || 8888; | |
module.exports = { | |
// devtool: 'eval', | |
cache: true, | |
progress: true, | |
colors: true, | |
watch: true, | |
entry: [ | |
`webpack-dev-server/client?http://${host}:${port}`, | |
'webpack/hot/only-dev-server', | |
'./src/bootstrapper.js' | |
], | |
output: { | |
filename: 'bundle.js', | |
path: __dirname + '/dist', | |
publicPath: `http://${host}:${port}/dist/` | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin() | |
], | |
resolve: { | |
extensions: ['', '.js', '.jsx', '.json'], | |
modulesDirectories: ['node_modules'] | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.(js|jsx)$/, | |
loaders: ["react-hot", "6to5-loader"], | |
exclude: /node_modules/, | |
}, { | |
test: /\.json$/, | |
loader: "json-loader" | |
}, { | |
test: /react-googlemaps/, | |
loader: "6to5-loader" | |
}, | |
{ | |
test: /\.md$/, | |
loader: "html!markdown" | |
} | |
], | |
}, | |
externals: { | |
'jquery': {} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment