This section provides an overview of what ember-cli is, and why a developer might want to use it.
It should also mention any large subjects within ember-cli, and link out to the related topics. Since the Documentation for ember-cli is new, you may need to create initial versions of those related topics.
Simple syntax to create a project is :
ember new my-new-app
cd my-new-app
ember s
Kindly check instruction to setup ember-cli in this document
Ember-Cli is a powerful tool which comes with many others to help us deploying faster and convenient. All you need to install Ember-Cli-Deploy and use ember deploy
.
Ember CLI Deploy structures your app’s deployment using a deploy pipeline, which consists of several pipeline hooks. These standard hooks are the foundation for a rich ecosystem of plugins which you can compose to create a deployment process suitable for your application.
As Ember-Cli-Deploy is an addon of Ember so you can easily install that with ember install ember-cli-deploy
. There are two useful other add-ons which make our build and compressing reliable during deployment.
Simply run the following commands:
# Install the Build plugin, which builds your app during deployment
ember install ember-cli-deploy-build
# Gzip our files
ember install ember-cli-deploy-gzip
However, if you are going to maximize your benefits using ember deploy
, it's most likey to have different environments in your Ember application and deploy production,staging or development version of your app with the appropriate configuration.
Platforms that you can deploy by now are:
Kindly refer to example section to see how you can deploy.
Just pass --pod
to ember generate
when generating new files.
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
}
The following would occur when generating a route:
ember generate route taco
installing
create app/taco/route.js
create app/taco/template.hbs
installing
create tests/unit/taco/route-test.js
ember generate route taco --classic
installing
create app/routes/taco.js
create app/templates/taco.hbs
installing
create tests/unit/routes/taco-test.js
There are some benefits to use this method, however, it's completely up to you.Firstly, it separates your application into more logical groupings, thus, you can keep your files neatly organized into resources.
This structure also makes our development's life easier. For instance, if I want to find the myname
controller
in the default structure, I need to preface what I actually want (myname) with the type (controllers). However, with pods, I can fuzzy-find the same controller by simply looking up “myname.”