Webpack – background images not loading

There is currently a bug when using sourceMap with css-loader. Removing sourceMap from your css loader should fix it. “module”: { “loaders”: [ { “test”: /\.scss$/, “loaders”: [“style”, “css”, “sass?sourceMap”] }, { test: /\.jpg$/, loader: “file-loader” } ] } Issue is related to: https://github.com/webpack/css-loader/issues/296

unable to see request logs in webpack-dev-server

Basically, webpack-dev-server uses express to spawn a webserver. To enable seeing logs, one needs to set DEBUG environment variable as required by express export DEBUG=’express:*’ This started showing me logs of various requests received by webpack-dev-server. To disable the logs, set the environment variable empty again export DEBUG= This works even for loopback projects and … Read more

How to configure webpack dev server with react router dom v4?

I do not think it has anything to do with webpack-config. Here is a basic github repository using react-router-4.0. I have created this example without any specific changes related to react-router-4.0 in webpack config. Add ‘devServer’ in your webpack config if not already: devServer: { historyApiFallback: true, } Two small suggestions in your code, try … Read more

How to watch certain node_modules changes with webpack-dev-server

You can config in in webpack.config file or in WebpackDevServer option, to watch for changes also in node_modules (i think that by default webpack watching for changes in all files) https://webpack.js.org/configuration/watch/#watchoptions-ignored in the following example webpack ignored all changes in node_modules folder except specific module. watchOptions: { ignored: [ /node_modules([\\]+|\/)+(?!some_npm_module_name)/, /\some_npm_module_name([\\]+|\/)node_modules/ ] } ignored[0] = … Read more

Webpack-dev-server not bundling even after showing bundle valid message

I’ve got the issue resolved by myself. Silly as it sounds but the issue was with the publicPath under the output object. It should match the path property instead of just /build/, i.e., output: { path: path.join(__dirname, ‘build/js’), publicPath: ‘/build/js’, // instead of publicPath: ‘/build/’ filename: ‘[name].js’ },

Customise ng serve to proxy calls to /api?

You can indeed setup a proxy to backend with the angular cli, with the –proxy-config flag. Here is more or less a copy-paste from the documentation: Say we have a server running on http://localhost:3000/api and we want all calls to http://localhost:4200/api to go to that server. We create a file next to projects package.json called … Read more

webpack-dev-server does not watch for my file changes

In order to get webpack to watch my file changes (Ubuntu 14.04), I had to increase the number of watchers (I had increased the number before, but it was still too low): echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p Source in the official docs: https://webpack.github.io/docs/troubleshooting.html#not-enough-watchers I first suspected the cause to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)