Discussion on: Setting up a minimal Node environment with Webpack and Babel

robekay1 profile image

First of all I wanna mention that this tutorial helped me a lot to understand the basics of webpack, babel and so on ...

The only thing I do not appreciate with this implementation is that when loading the html-site there is a clear delay visible when adding some style to the stylesheets.

For example, everytime I reload the site all the buttons and textfields which I have added to the html-file are first loaded in the "standard html look" and a split second later my css styling is added and they appear in the way they should.

This is definetly not a huge issue, but it is not very pleasant.

Does anyone maybe know how to fix that issue? :/

lyrod profile image

You'll need extract-text-webpack-plugin (Webpack 3) or mini-css-extract-plugin (Webpack 4) so the scss files are bundled into a css file.

html-webpack-plugin should add it to the head of the index.html and browsers will load it before rendering the application.