react-redux-typescript-boilerplate icon indicating copy to clipboard operation
react-redux-typescript-boilerplate copied to clipboard

[HOW] React Hot Loader integrating

Open tomzaku opened this issue 5 years ago • 0 comments

This package is awesome! I would like to apply React Hot Loader in my project. But I config same as you but still not working. Tell me if I missing

webpack.config.js

// about plugins
// 1st Remove new webpack.HotModuleReplacementPlugin(),
// 2nd about devServer
devServer: {
	hot: true,
	inline: true,
},
 // 3rd about module
module: {
	rules: [
	//...
	{
		test: /\.(ts|tsx)?$/,
		include: appPath.appSrc,
		use: [
					{
						loader: 'babel-loader',
						options: { plugins: ['react-hot-loader/babel'] }
					},
					{
						loader: require.resolve('ts-loader'),
						options: {
							// disable type checker - we will use it in fork plugin
							transpileOnly: true,
						},
					},
				],
	},
],

App.js

// 4th import hot
export default hot<any>(module)(AppConfig)

tomzaku avatar Feb 18 '19 11:02 tomzaku