search

Home  >  Q&A  >  body text

angular.js - Problem with deploying code into production environment after angular development

Our front-end is developed with angular2. After compiling webpack and packaging, how is the production environment handled?
Is it enough to just put the packaged js and html files on the server? Do I need to install a front-end server in the production environment? How to deal with the angular dependencies and other dependencies such as webpack used in our development?

習慣沉默習慣沉默2744 days ago673

reply all(4)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:22:24

    After building, just throw the dist directory to the server, nginx will forward it and it’s done

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:22:24

    Static resources such as js, html, and image styles are required. node_modules need to be placed in the js and html folders or their outer layers. Webpack dependencies are not required

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:22:24

    Package and build directly with the appropriate webpack plug-in. Considering the optimization of the project, you can use lazy loading, AOT, etc. For development, it is best to install webpack-dev-server for easy debugging. You can check out my starter when you have time

    reply
    0
  • 为情所困

    为情所困2017-05-16 13:22:24

    After packaging, just put it directly on the server. Everything you depend on is included in the package

    reply
    0
  • Cancelreply