This repository has been archived by the owner on Aug 21, 2020. It is now read-only.
How to use with eslint preloader? #15
Comments
What does your webpack.config.js look like? |
const path = require('path');
const webpack = require('webpack');
const assign = require('object-assign');
const config = require('./webpack.config');
module.exports = assign({}, config, {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client',
'./index',
],
output: {
filename: 'bundle.js',
path: path.resolve('./public'),
publicPath: '/public/',
},
module: {
preLoaders: [
{
test: /\.js$/,
loader: 'eslint',
include: [__dirname, path.join(__dirname, '../components')],
exclude: [path.join(__dirname, '../', 'node_modules')],
},
],
loaders: [
{
test: /\.(woff|woff2|gif|png|jpe?g)$/,
loader: 'url-loader',
}, {
test: /\.svg$/,
exclude: /icons\/.+\.svg$/, // exclude all icons inside /icons folder
loader: 'url-loader!svgo-loader?useConfig=svgoConfig',
}, {
test: /icons\/.+\.svg$/,
loader: 'raw-loader!svgo-loader?useConfig=svgoConfig',
}, {
test: /\.js$/,
loaders: ['babel'],
include: [path.join(__dirname, '../')],
exclude: [path.join(__dirname, '../', 'node_modules')],
}, {
test: /\.css$/,
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]-[local]!postcss-loader',
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
},
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],
}); Just dumping the |
Good to know. I guess you should create an issue here: https://github.com/glenjamin/webpack-hot-middleware/. |
Is this same as gaearon/babel-plugin-react-transform#12? |
I can't really tell but it seems about right. Closing. Also: thanks @gaearon ! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm not sure exactly where to put this and I apologise if this is the wrong repo — but I ran into an issue where if I used
babel-eslint
as a preloader (or before babel in the webpack loader config), hot reloading just would not work, and I always had this message:No idea if this is a bug or what — just that I spent a long time trying to debug it!
Perhaps it will be of use to someone...
The text was updated successfully, but these errors were encountered: