Skip to content

Added option to only copy the packages that are declared in bower.json:depedencies#147

Open
roy8000 wants to merge 4 commits into
yatskevich:develfrom
roy8000:devel
Open

Added option to only copy the packages that are declared in bower.json:depedencies#147
roy8000 wants to merge 4 commits into
yatskevich:develfrom
roy8000:devel

Conversation

@roy8000

@roy8000 roy8000 commented Nov 26, 2014

Copy link
Copy Markdown

Hi,

i added a new option "onlyDependencies" so that when "copy" is set to true, it only takes the packages declared in bower.json:depedencies.

For example if you want to use only bootstrap css and fonts but not its javascript, in the old version you could declare something like this in bower.js:

  "exportsOverride": {
    "bootstrap": {
      "css": "dist/css/*.*",
      "fonts": "dist/fonts/*.*"
    }
  }

but it will copy the jquery depedency because bower installs it in bower_components as it's a declared depedency of bootstrap.

so by adding the onlyDependencies property in the task declaration in gruntfile.js:

        bower: {
            install: {
                options: {
                    targetDir: "./wwwroot/lib",
                    layout: "byComponent",
                    onlyDependencies: true,
                    bowerOptions: {
                        production: true
                    }
                }
            }

it'll only install the css and fonts of bootstrap.

@buschtrisha77 buschtrisha77 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure who made these changes. I have been hacked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants