How do I build Ember to use as portable? (be able to move to any folders)


I had built Ember in production environment but it have the rootURL every where in link and script tags. For example:

<link href="/test/ember/dist/....">
<script src="/test/ember/dist/...">

The HTML that were built works fine, nothing wrong. But if I want to pack it and share and let any user to download and then extract it to anywhere (in the web server) is hard. Users have to find and replace text in .html file which is not convenient for them.

I just want them to just download and extract to anywhere and works.

How do I build Ember to use as portable? (extract to use in any folder name for the web server, no need to change root URL)


You can use:


I’m not sure is that working in the web server like Apache? I means I want to use it in the web server.


No it generates an executable for your Ember app your users can download and run.


Thank you but I’m afraid that this is not what I want. I just want to extract html+js+css package build by Ember anywhere and run in the web server like Apache.


In that case perhaps add this:

and change rootURL at runtime:

// Snipped from /app/router.js
import Ember from 'ember';
import ini from './ini.js';

const Router = Ember.Router.extend({
  rootURL: ini.rootURL

Add some kind off ini.js containing the rootURL in your public folder. Perhaps you can even skip the ini and use ‘REQUEST_URI’ but I am not sure how you would do this.