This is bugging me as it is a bit of a hurdle I can’t see how we overcome.

I want to be able to add JSON to a preload store (or initialize a model when the app loads) in index.html before it reaches the browser. to do this using a preload store I would need the ember app to live inside some sort of server side app - we use .NET and ServiceStack.

I can get my server side code to treat index.html as dynamic so i can output the JSON for the preload store - however - if i put this in the /dist folder I get errors where .js files aren’t found.

If you want your entry point to be a server-side app, develop against that, run ember build --watch to keep dist updated and have your server-side app serve out of dist. You lose support for livereload, but that’s not the end of the world.

This is the same issue - I am surprised this isn’t sorted… I’ve been spinning my wheels for days on this trying to figure out work arounds etc

Thanks for the heads up

lukemelia:

If you want your entry point to be a server-side app, develop against that, run ember build --watch to keep dist updated and have your server-side app serve out of dist. You lose support for livereload, but that’s not the end of the world.

I don’t care about losing livereload!

The only thing here is that /dist seems to get wiped out everytime it’s updated - so my server side files are all lost

Yes, you need to let ember-cli own dist. The two approaches I’ve used successfully is to pull in ember-cli assets via bower (use bower link for local development, which uses symlinks), or use a local proxy like nginx to send requests to the appropriate development server based on URL.

Don’t run your production app using ember serve. All of that is for more for development, and the express server isn’t souped up for it.

What you need to do is run ember build environment --production and that will build your files to /dist. It’s a simple index.html file with supporting assets (css,js, etc). You need to use the static assets and deploy those files however you normally do it.

My answer isn’t going to help much, but I’m posting anyway. LinemanJS addresses this issue by supporting both API stubbing and API proxying. In development, you can point lineman to a live-running instance of the server-side application (or api) and requests to lineman’s dev server are proxied. Additionally, you can build out the client-side application before the server-side app is ready by creating stubbed responses, which Lineman will serve from the dev server.

This allows you to dev/debug against non-minified assets, while still hitting the upstream server-side app (or stubs).