简体   繁体   中英

NodeJS and client-side Javascript in Ember application

I am working on developing a client-side application built on EmberJS.

Now, while I test the code in the browser ultimately, I have the following locally for development;

  1. NodeJS & NPM
  2. I have defined bower.json & package.json
  3. I use ember-cli & do ember build & ember server to start the local server
  4. I hit the URL http://localhost:4200 in the browser to access the app

Now my question is I wanted to understand, what exactly is happening here ? Meaning what exactly happens before code runs in the browser.

I understand when the build happens, it actually pushes code into the 'dist' directory.

Is there any role in NodeJS in all of this (meaning any JS run on server-side in the background) OR we just utilize npm/bower for this case ?

So I just wanted to connect all the dots regarding running in the browser.

browsers don't support the features of modern javascript, so when you end up deploying your ember site, you only need to deploy static files (from the dist directory), and you actually don't need a server at all.

This is how https://emberclear.io works (no server, just a CDN).

The NodeJS things are purely for pre-deployment needs (development, transpiling, testing, etc).

Hope this helps.

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