2

I just started using Ember for a real application, and already got myself into a bit of a bind.

I set up my environment.js file with the following:

modulePrefix: 'appname',
podModulePrefix: 'appname/pods'

However, this did not work and Ember CLI continues to generate files in the old/normal structure. I unfortunately did not even notice until I had a decent amount of work done... cause I was excited just to have an Ember app going! ;)

So the question I have is two-fold:

  1. Why is podModulePrefix not working? I've read up on it, and it seems like it should be fine. I'm probably missing the point on why it's not working.
  2. How can I migrate my existing file structure into the pod structure? Is it just manually doing so, or is there a tool out there that helps with things?

Thanks for any help!

Gurnzbot
  • 3,742
  • 7
  • 36
  • 55

1 Answers1

2

I am going to answer

1- you should just stop Ember and start again and your code should be

 podModulePrefix: 'app/pod', //just an example 

then start creating a test component like

ember g component test-com --pod

the result would be this

installing component
  create app/pod/components/test-com/component.js
  create app/pod/components/test-com/template.hbs
installing component-test
  create tests/integration/pod/components/test-com/component-test.js

2- no way, you must just simply create and copy and paste your code.

If you would like to use the pods structure as the default for your project, you can set usePods in your .ember-cli config file to true (setting was previously named usePodsByDefault). To generate or destroy a blueprint in the classic type structure while usePods is true, use the --classic flag.

With the usePods set to true.

// .ember-cli
{
    "usePods": true
}
Majid
  • 2,507
  • 2
  • 19
  • 18
  • I am marking your answer as accepted, if only for the 2nd point `"usePods": true`. That should be way more prevalent in the documentation IMO ;) I ended up archiving the old project, starting a new one with a bare structure, ensured my config/environment files were correct, and just starting fresh. Took no time at all to just set up the few routes and components I had. Thx! – Gurnzbot Sep 26 '16 at 02:43