More basic workflow (http-server, etc.)
CaptainN opened this issue · 2 comments
I've been using JSPM for a while, and just set up a new project on 0.17. It's a bit confusing to figure out how to run the dev server, and get everything up and running (the guide mentions hot loading, but not the basic dev server setup), so I thought I would mention some things that maybe could be clarified in the docs.
One unclear point is how to get a local dev server up and running. I know that's something people have some opinions about (and it gets into grunt vs gulp vs npm scripts, etc.), but maybe a quick mention that you need to run both a local server of any kind (http-server for example) and the chokadar hot load emiter would be nice. There is a package called jspm-server that doesn't appear to be compatible with 0.17.
Another thing is how to run and kill multiple services, which appears to be required for hotloading to work, from npm scripts. I know that's a general knowledge, but it's the kind of thing that could trip folks up.
Other confusing things:
- How do I get JSPM to use a separately linked js package like jQuery - very challenging to figure out. You can't just avoid importing it either, because some other modules will probably pull in another copy. This makes it challenging to mix JSPM with something like WordPress which manages a certain set of JS libraries, or to use CDNs. (this one is in the docs, but it is for some reason unclear, at least to me - there seems to be a few different keys to set, or perhaps they are options - I really can't tell if I should use them all, or just pick one - or why, etc.)
- How to have production html and development html at the same time (development to use separate files, or a dev bundle, and production to use a production bundle, etc.). It'd be great to have some guidance on that.
I know there are a billion ways to do all of these things, but that is part of the problem. Some sensible defaults to answer those questions would match the philosophy at the core of JSPM - to make things quick and easy.
I think there would definitely be scope to have a tool that tied together the jspm workflow into some standard practises. Things like setting up a server, the hot reloading etc etc.
jspm-server as a concept is a good idea. Someone just needs to work on it.
The way it is now, I have 4 things running to test locally - http-server, chokidar-hot-reloader, a development bundle watcher, and a node-sass watch command (which compiles to the CSS file that I have linked in - but hotloading of that css doesn't work so far). The forth one is obviously additional, but it'd be nice to be able to to run one thing and get all 3 working straight away.