ondras/primitive.js

watchs

darlanmendonca opened this issue · 6 comments

one suggestion to improve the work

actually you have use of rollup to bundle script, and lessc to compile styles. but this run only when dev run the scripts js and css or use watch, but this watch only scripts, not styles, or markup (html).

my suggestion is use a local server, to access the index.html on browser, on a localhost, and watch html, css, js, and auto refresh the browser on changes occur.

I suggest browser-sync to this, their works with socket.io to auto refresh, and their is just a express.js server :D

what you think?

Too complex. The build infrastructure shall not be larger than the resulting project. If you want watching, I suggest using a trivial inotify-based solution, such as this oneliner: https://github.com/ondras/es6-boilerplate/blob/master/Makefile#L10

but the inotify can do a autorefresh on browser?

if it is very complex, I agree, is a bad thing.

But I believe that if it's in a npm script, the complexity decreases.

The rollup is a devdependency, browser-sync could be too, I guess. What do you think?

about inotify, I dont understand how use it :D

No, inotify watches for file changes. I do not want to introduce any kind of autorefresh, please.

ok :(

I can use it on "hands", rs, like

npm start && browser-sync -s '*.js, *.html, *.css'

so I install browser-sync as global module in my machine.
my intention was have this on npm scripts, to just

npm start

but if you dont like, all right

If you prefer that setup for your workflow, then by all means, do it (locally or with your fork)! I just consider that an overkill for this kind of project (which is now, more-less, completed).

yep, is a point, I understand

and sounds good thing do it in my forked, I dont think in that, you're right