D
D
Desire23042018-03-30 23:48:11
css
Desire2304, 2018-03-30 23:48:11

Why doesn't webpack track style changes?

No matter how I used boilerplate with Webpack, there is one problem everywhere: changes in styles (in my case Stylus) connected via @import. That is, there is a main style file app.styl, and all other styles are imported into it, changes to them are not displayed in the browser in any way - you either have to restart the server ( npm run dev) or make a change in app.styl. Itself app.stylis connected in main.jsthis way:
import './styles/app.styl';.
Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Desire2304, 2018-03-31
@Desire2304

I figured it out - the problem was that in app.styl I imported styles in this way:
Webpack does not understand Stylus variables and simply ignores such imports. If you write without a variable, then everything will work:

@import '../../components/Navbar/navbar.components'

T
TheBububo, 2018-03-31
@TheBububo

There was a similar problem with webstorm, try changing the file in notepad ++ and saving to see if it's in the editor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question