Hello David,
On 15/05/14 23:09, dbashford wrote:
> 2. There are ton of options with .html files. If you are using Angular,
> you are probably using .html files as your templates? In that case
> they'll just be copied over if you put them in assets. Or are you
> talking about server assets? The layout of a mimosa new project is
> based on the layout of an Express application, see below. It seems you
> are new-ish to node?
Yes, that's a fair assessment.
> So it makes sense that that layout doesn't make
> sense to you. node often IS what is serving assets.
>
> If you don't like having your server views outside of your client
> assets, you can put them in assets and point mimosa at them. Again,
This may be a bit of terminology differences. I don't think I've seen a
definition of "assets", except that in the context of Brunch
configuration conventions "assets" refers to anything that "won't be
compiled and will be just moved to public directory instead." So I
tend not to think of .coffee, .styl, etc. as "assets".
> nothing stopping you, but because all the server options are node ones,
> the project layouts you see are node application layouts. We have a
> project at my 9-to-5 that has jade views in a /views for the Express app
> we run in dev. But we deploy to a non-node enviroment and we use
> mimosa-server-template-compile which by default dumps the compiled jade
> files into public. (And none of this has anything to do with AMD/CommonJS)
OK, I added mimosa-server-template-compile to the mimosa-minimal config
and that indeed created a build/index.html from the views/index.jade.
But if I understand correctly from the first para above, I could just
put .html files under assets/ and they'll be copied over to public/ so
that they can be served by nginx or some other server instead of, say,
express.
> $ express bar
>
> create : bar
> create : bar/package.json
> [...]
> create : bar/public/stylesheets/style.css
I wasn't familiar with the express-generator (which is where this comes
from), only with the API.
> 3. "-p" is a flag to let packaging modules know that they need to do
> their stuff. mimosa-minimal, mimosa-ember-emblem-templates, and "mimosa
> new" apps do not have a packaging module. So -p will do nothing. The
> only packaging module that I know of is mimosa-web-package. You have to
> have that in your project to get packaging. Just add "web-package" to
> your modules array.
Actually, mimosa-ember-emblem-templates *does* include web-package.
Hence, the errors I mentioned.
> 4. I'm not sure why you aren't seeing your JavaScript files concated and
> minified. "mimosa new" projects should have no trouble having all the
> .js packaged into a single file with mimosa build -o. Most of the
> mimosa skeleton projects use requirejs and its the "require" module that
> is responsible for understanding your requirejs app and how to optimize
> it. If you prefer to not use AMD/require, there is a mimosa-browserify
> module that will optimize your commonjs apps. It's not as "smart" as
> the require module, so it requires more config.
I didn't try very hard to get them concat'd, thinking that -o or -p
would do the trick but as I said I ran into errors.
> And, btw, I would argue that in development mode there is 0 value in
> concatenating files. We have require apps that locally load up in
> seconds, and which take seconds to bundle when we do build them. So you
> can have your app re-bundled every time you change a file, which itself
> takes time, or you can serve up individual files, a much faster build
> and a little longer load time, but with a much easier debugging experience.
I agree that concat'ing in dev mode probably has negligible value but I
guess it depends on using Require/CommonJS. If not using one of those,
using a couple of script tags as Brunch does, vs. maintaining multiple
ones may be advantageous (note that I'm *not* arguing in favor of the
un-modularized approach).
> [snip]
>
> Hope that all helps. If you have any questions left, please feel free
> to ask em. I hope that narrowed your list down some. =)
Yes, indeed. Thank you.
Joe