Va1 / browser-sync-webpack-plugin

Easily use BrowserSync in your Webpack project.
MIT License
369 stars 40 forks source link

Use the compilation trigger to determine whether CSS injection should happen instead of emitted asset names. #79

Open farmerau opened 5 years ago

farmerau commented 5 years ago

Per discussion on #78 , I've created this. It might be worth deleting lib/getCssOnlyEmittedAssetsNames.js since I've removed the one call to it's method, but I wasn't sure if that was my place on this adjustment.

I also created an option that defaults to scss/sass/less/css as the regular expression for comparison against the compilation trigger.

farmerau commented 5 years ago

It looks like this PR might resolve issues in #69 and #70 as well.

henrijs commented 5 years ago

Tested and works. My setup uses mini-css-extract-plugin that extracts css.

Brendonwbrown commented 5 years ago

I cannot seem to get this working. Can you please share your config?

farmerau commented 5 years ago

@Brendonwbrown It might be better to see an example of where it isn't working for you.

farmerau commented 5 years ago

@Va1 any thoughts on this? =)

weilinzung commented 5 years ago

any updates?

Va1 commented 4 years ago

can someone verify this works and, if it does, that it does on all webpack major versions available?