Open jackfranklin opened 8 years ago
Want some help in building a cli?
@blittle would love some!
I'm pretty invested in jspm right now, so I'd love to help. I'll hold off until we can figure out https://github.com/jackfranklin/jspm-dev-builder/issues/9 which has me baffled.
:+1: agreed, pretty keen to route out the problem of #9.
@jackfranklin Would it be best to include the CLI within this or a separate project?
I'd like it with this.
@blittle BTW let's not hold off on this, happy to take PRs whenever. #9 looks like being a pain!
It might not have to hook into a hot reloader thing. The jspm-dev-builder cli could just be running, rebuilding (incrementally) on file changes separately from someone's favorite webserver (like browser-sync or caddy) and something like the chokidar-socket-emitter. Using the jspm-dev-server the last two are combined. This would allow much faster initial site loading and full page refreshes and a hot reloader could then pick up regular file changes, enabling retaining state.
This could easily be combined in a npm script like:
"scripts": {
"start": "npm run serve & npm run build & npm run emitchanges",
"serve": "browser-sync start --server",
"build": "jspm-dev-builder -w",
"emitchanges": "chokidar-socket-emitter"
},
As of jspm-0.17-beta12
this is now built in to jspm. I don't see much reason to build this for older jspms (I'd like to encourage movement to latest version!) but if someone would like to I'd still be happy to include it.
@peteruithoven Or I'm mistaken, or your npm start
will never work as you expect it to work. It will run Browser Sync and then will stuck with it, so npm run build
will be never executed
@ArmorDarks No, this works, maybe you're confusing the &
with &&
.
Turns out &
doesn't work in Win's cmd native environment. The only way to do same thing is to use node-run-all
with --parallel
flag. So, my bad, sorry.
So people don't have to implement the CLI tool themselves.
It should allow the user to run a command which:
**/*.js
, excluding some sensible defaults), and rerun the app