Bundle doesn't rebuild if material-ui imported
See original GitHub issue- Operating System: Ubuntu 16.04
- Node Version: 8.9.1
- NPM Version: 5.5.1
- webpack Version: 4.12.0
- webpack-dev-server Version: 3.1.4
- This is a bug
- This is a modification request
Code
// webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/client/index.js',
output: {
path: path.resolve('build'),
filename: 'bundle.[hash].js',
publicPath: '/'
},
resolve: {
extensions: ['*', '.js', '.jsx'],
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: 'babel-loader'
},
]
},
plugins: [
new HtmlWebpackPlugin({
template: './src/client/index.html',
inject: 'body'
})
],
devtool: 'inline-source-map',
devServer: {
contentBase: './build',
historyApiFallback: true,
hot: true,
host: 'localhost',
port: 3000,
proxy: {
'/api': 'http://localhost:8000',
},
},
};
// babelrc.
{
"presets": [["env", { "modules": false }], "react", "stage-2"],
"plugins": [
"react-hot-loader/babel",
["transform-runtime",
{
"polyfill": false,
"regenerator": true
}],
"emotion"
]
}
// App
import React from "react";
import DeleteIcon from "@material-ui/icons/Delete";
class App extends React.Component {
render() {
return <div>hello text</div>;
}
}
export default App;
// run command
webpack-dev-server --mode development --inline --hot
Expected Behavior
bundle will rebuild if App.js changed
Actual Behavior
bundle didn’t rebuild
For Bugs; How can we reproduce the behavior?
https://codesandbox.io/s/nn61v1vyw4 issue in material-ui
Use run command when “//import DeleteIcon from “@material-ui/icons/Delete”;” and change “hello text” - bundle rebuild.
Use run command when “import DeleteIcon from “@material-ui/icons/Delete”;” and change “hello text” - bundle didn’t rebuild.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
reactjs/material-ui app is whooping 917kb in production ...
I use create-react-app and do "npm run build" to create prod builds. Also I have used webpack independently to create production build. In...
Read more >Minimizing bundle size - Material UI
The bundle size of MUI is taken very seriously. ... While importing directly in this manner doesn't use the exports in the main...
Read more >Jetpack Compose Tutorial
In this tutorial, you'll build a simple UI component with declarative functions. You won't be editing any XML layouts or using the Layout...
Read more >Troubleshooting
If the module points to an npm package (i.e. the name of the module doesn't with ./ ), then it's probably due to...
Read more >Troubleshooting Common Errors
If you encounter a webpack error that says Generating SSR bundle failed after installing a plugin and trying to run gatsby develop or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ntbm yes, i run node process with wds and it works.
Also, problem may be in https://stackoverflow.com/questions/51622851/webpack-dev-server-does-not-rebuild-bundle In general, I now don’t have this problem.
@Dozalex Thank you, the Stackoverflow thing brought me to me solution. As I can’t change the file watches. I could work around with --watch-poll
https://stackoverflow.com/questions/42584315/webpack-dev-server-doesnt-watch-recompile-files-if-they-import-named-exports