webpack-autoconf icon indicating copy to clipboard operation
webpack-autoconf copied to clipboard

Add webpack-dev-server to Vanilla JS projects (No React or VueJS)

Open JuanmaMenendez opened this issue 5 years ago • 9 comments

JuanmaMenendez avatar May 22 '19 02:05 JuanmaMenendez

This is also a good idea, will work on this also next time I have time to work on this project. Always feel free to send PR :)

jakoblind avatar May 24 '19 06:05 jakoblind

@JuanmaMenendez

Are you asking functionality similar to nodemon ? Like you need webpack-dev-server just to watch and bundle the js files?

Or do you have any other expectations?

theajr avatar Oct 18 '19 10:10 theajr

@theajr I am asking we can start a Vanilla project and have (babel, css preprocesor, typescript, etc.. )

@jakoblind I think that is possible right now, I am ok ? Maybe we should close this issue?

JuanmaMenendez avatar Oct 18 '19 13:10 JuanmaMenendez

Most of it is possible right now, but webpack-dev-server is only available as a script in package.json if you select React hot loader. Should we consider having the script there at all times?

image

jakoblind avatar Oct 21 '19 07:10 jakoblind

@jakoblind yes, we should give webpack-dev-server script if user don't select any of the given framework. Because in given use case, user don't need react. We don't show React Hot Loader unless user selects React.

theajr avatar Oct 21 '19 07:10 theajr

But we should leave out --hot parameter if React hot loader is not selected I think. Because some extra code on frontend is needed for hot module replacement to work.

jakoblind avatar Oct 21 '19 07:10 jakoblind

I don't think so, let me know if I am wrong. We need extra code only in case of react to utilise react-hot-loader's HMR feature instead of refreshing the entire browser tab. If we don't have extra code, then it will refresh the browser tab. I guess it should be okay in this case?

theajr avatar Oct 21 '19 07:10 theajr

Yes, you are correct. There was some time ago I worked with this, thanks for reminding me how it works!

So the task is then to always show the start script in package.json (and make sure it works in Vue as well, if not, don't show for Vue)

jakoblind avatar Oct 21 '19 07:10 jakoblind

Yeah, we should do it. You may assign this to me.

theajr avatar Oct 21 '19 07:10 theajr