Question

I have used yo angular for my project.
Now I wanted to added bootstrap-sass-official which I did using
bower install --save bootstrap-sass-official

When I run grunt serve it automatically adds the javascript files to index.html, which I dont want.

I am using ui-bootstrap for modals and other components.

How do I stop grunt serve from adding of additional javascript files?

Was it helpful?

Solution

I fixed it by commenting a part of bowerInstall task.
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.

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/'
            }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top