简体   繁体   English

如何停止grunt服务以自动添加文件

[英]How to stop grunt serve to automatically adding files

I have used yo angular for my project. 我在项目中使用了yo angular
Now I wanted to added bootstrap-sass-official which I did using 现在我想添加我确实使用过的boots-sass-official
bower install --save bootstrap-sass-official

When I run grunt serve it automatically adds the javascript files to index.html, which I dont want. 当我运行grunt serve它会自动将javascript文件添加到index.html中,这是我不想要的。

I am using ui-bootstrap for modals and other components. 我正在将ui-bootstrap用于模式和其他组件。

How do I stop grunt serve from adding of additional javascript files? 如何停止添加额外的javascript文件?

I fixed it by commenting a part of bowerInstall task. 我通过注释bowerInstall任务的一部分来修复它。
Now I have to add the files manually but I have the flexibility to decide for myself. 现在,我必须手动添加文件,但是我可以自行决定。 I can still see which files were to be added automatically, from bower.json (search for "main") file inside the bower_component/component_name folder. 我仍然可以从bower_component/component_name文件夹内的bower_component/component_name (搜索“ main”)文件中看到要自动添加的文件。

Earlier: 之前:

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

Now: 现在:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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