Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using another environment than development || production breaks ember build #662

Closed
frekw opened this issue May 8, 2014 · 7 comments
Closed
Labels

Comments

@frekw
Copy link

frekw commented May 8, 2014

It just throw the following error You must pass a file toEmberApp::import. For directories specify them to the constructor under thetreesoption. when using ember build --environment=staging.

My guess is that the following line is the culprit since it only adds development and production.

@stefanpenner
Copy link
Contributor

This is fixed on master

@frekw
Copy link
Author

frekw commented Jun 13, 2014

@stefanpenner I'm still seeing this issue with 0.0.34.

ember build --environment=staging yields the following error:

You must pass a file to `app.import`. For directories specify them to the constructor under the `trees` option.

However, ember build --environment=production works fine. I suspect that the ember and handlebars imports are the culprit, but overriding them like so:

app.import({
  development: 'vendor/handlebars/handlebars.js',
  staging: 'vendor/handlebars/handlebars.js',
  production:  'vendor/handlebars/handlebars.runtime.js'
});

doesn't seem to have any effect.

@rahult
Copy link

rahult commented Jun 19, 2014

I am getting the same error with 0.0.34

ember build --environment testing --output-path build

@rwjblue
Copy link
Member

rwjblue commented Jun 19, 2014

Yep, nothing has changed to make that work.

It is still on the agenda.

@pascalopitz
Copy link

Workaround:

EmberApp.prototype.populateLegacyFiles = function () {

  this.import('vendor/loader/loader.js');

  this.import('vendor/jquery/dist/jquery.js');

  this.import({
    development: 'vendor/handlebars/handlebars.js',
    testing: 'vendor/handlebars/handlebars.js',
    staging:  'vendor/handlebars/handlebars.runtime.js',
    production:  'vendor/handlebars/handlebars.runtime.js'
  });

  this.import({
    development: 'vendor/ember/ember.js',
    testing: 'vendor/ember/ember.js',
    staging:  'vendor/ember/ember.prod.js',
    production:  'vendor/ember/ember.prod.js'
  });

  this.import('vendor/ember-cli-shims/app-shims.js', {
    ember: ['default']
  });

  this.import('vendor/ember-resolver/dist/modules/ember-resolver.js', {
    'ember/resolver': ['default']
  });

  this.import('vendor/ember-load-initializers/ember-load-initializers.js', {
    'ember/load-initializers': ['default']
  });
};

@stefanpenner
Copy link
Contributor

closing in favor of new configuration stragety

@quantuminformation
Copy link
Contributor

Is there a way to have a staging build mimic the settings for production?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants