简体   繁体   中英

Is there any difference in the dist/ folder generated when ember build vs ember serve?

When I run ember serve, a new dist folder is generated every time. Is this folder the same as the one generated when I run ember build?

No difference. It's same unless you specify environment flag. Both ember build and ember server if you didn't specify --environment flag (possible values are development,production) by default it will build for development environment.

In ember-cli user guide explained clearly,

ember build

Builds the application into the dist/ directory (customize via the --output-path flag). Use the --environment flag to specify the build environment (defaults to development). Use the --watch flag to keep the process running and rebuilding when changes occur.

ember server

Starts the server. The default port is 4200. Use the --proxy flag to proxy all ajax requests to the given address. For example, ember server --proxy http://127.0.0.1:8080 will proxy all ajax requests to the server running at http://127.0.0.1:8080 . Aliases: ember s, ember serve

It is almost the same but with one crucial difference.

When you run ember serve it will also hook you up with livereload by injecting <script src="/ember-cli-live-reload.js" type="text/javascript"></script> into the head tag.

This makes the content of the dist -folder unsuitable for anything other then running it via Ember CLI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM