How does Ember CLI figure out project name / module prefix for existing Ember projects?


#1

Hey,

I’ve successfully migrated my project called "ShareDrop" to Ember CLI, but whenever I’m upgrading Ember CLI and run ember init, it generates project name and module prefix as "share-drop". Where does it take this name from? The project is in a folder called "sharedrop", but I’m not sure it’s important.

Assuming I change the name to “share-drop”, what will be the name of global variable created by ember-export-application-global - window["share-drop"]?


#2

CamelCase becomes dash-case and vice versa. I don’t think the directory name matters, I think it comes from the modulePrefix setting in config/environment.js.


#3

Thanks. Mystery solved - it takes the name from "name" property in package.json file. I changed it to FooBar and it started generating foo-bar everywhere, including newly generated package.json file… I guess using camel case for project name is not encouraged :smile:


#4

Ah, I did consider package.json but I thought, no, that doesn’t make sense! hehe glad you figured it out