search

Home  >  Q&A  >  body text

angular.js - yeoman创建好框架后,如何运行dist目录

dist是生成出来的,我的问题是:

1.
dist目录里面的东西和app里面的东西不一样,
到时候发布到线上的时候应该是dist目录。可是我一但开启服务直接跳转到app目录里面运行index.html,
而不是我想象的那样,运行的是dist目录的文件。

2.
我看了下html文件,里面css和js都是经过压缩过的,可是我没有发现第三方的插件,比如bootstrap,
angular 等等 js都没有,不知道啥情况。。。求解!!!

phpcn_u1582phpcn_u15822744 days ago664

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-15 17:00:39

    1. For development, you can use the following command to run the contents of dist:

      grunt serve:dist

    2. By default, all third-party js will be merged into verdor.xxxx.js, and your own js will be merged into script.xxxx.js
      The corresponding third-party css will be merged into verdor.xxxx.css, and your own css will be Merge into main.xxxx.css

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 17:00:39

    1. Carefully read the Generator you use yeoman. Generally speaking, it will provide detailed instructions on how to run the development environment or production environment.
    2. Read README.md
    3. Open package.json. There are instructions for npm related operations in the 'scripts' object.
    4. Open Gruntfile.js, which contains various instructions such as entry files and export files.

    In addition, grunt does the compression for you.

    reply
    0
  • Cancelreply