【问题标题】:How to stop grunt serve to automatically adding files如何停止 grunt serve 自动添加文件
【发布时间】:2014-04-26 10:50:46
【问题描述】:

我在我的项目中使用了yo angular
现在我想添加我使用
bower install --save bootstrap-sass-official

所做的 bootstrap-sass-official

当我运行grunt serve 时,它会自动将 javascript 文件添加到我不想要的 index.html 中。

我将ui-bootstrap 用于模态框和其他组件。

如何阻止 grunt serve 添加额外的 javascript 文件?

【问题讨论】:

    标签: angularjs twitter-bootstrap gruntjs yeoman bower


    【解决方案1】:

    我通过评论bowerInstall 任务的一部分来修复它。
    现在我必须手动添加文件,但我可以灵活地自己决定。 我仍然可以从 bower_component/component_name 文件夹中的 bower.json(搜索“main”)文件中看到要自动添加的文件。

    之前:

    bowerInstall: {
                app: {
                  src: ['<%= yeoman.app %>/index.html'],
                  ignorePath: '<%= yeoman.app %>/'
                },
                sass: {
                    src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                    ignorePath: '<%= yeoman.app %>/bower_components/'
                }
    }
    

    现在:

    bowerInstall: {
                /* app: {
                  src: ['<%= yeoman.app %>/index.html'],
                  ignorePath: '<%= yeoman.app %>/'
                }, */
                sass: {
                    src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                    ignorePath: '<%= yeoman.app %>/bower_components/'
                }
    }
    

    【讨论】:

      猜你喜欢
      • 2020-06-05
      • 1970-01-01
      • 1970-01-01
      • 2017-09-28
      • 1970-01-01
      • 2015-05-19
      • 2021-05-10
      • 2023-03-10
      • 1970-01-01
      相关资源
      最近更新 更多