generator-keystone icon indicating copy to clipboard operation
generator-keystone copied to clipboard

moving static resources into bower dependencies

Open izifortune opened this issue 11 years ago • 5 comments

I'm already using bower and grunt-wiredep in different projects with keystone. I was wondering if you think that this feature will be useful to the generator i can make a PR for that

izifortune avatar Jul 30 '14 21:07 izifortune

It's not a bad idea at all, I've been wondering if we should do this too.

Do the LESS source files for Bootstrap come down from Bower?

I've always had mixed results with bower and usually end up taking whatever files it provides, and moving / modifying them somehow (or just skipping the whole process because I want more control). It does seem to be getting better though, so perhaps worth another look.

JedWatson avatar Jul 31 '14 12:07 JedWatson

Yeah, i'm using it with sass ( work also for less ) and you just need to insert this comment into the your main file

//bower:scss
//endbower

wiredep will take care of that, and if you need more control over it you can specify overrides into your bower.json just like this:

  "overrides": {
    "slick.js": {
      "main": [
        "slick/slick.min.js",
        "slick/slick.css"
      ]
    }
}

and wiredep will include the main file you have written

izifortune avatar Jul 31 '14 13:07 izifortune

@JedWatson You can get less files for Bootstrap from Bower repo. That's what I am doing. Then -> I am simply including them in my main.less file and overwrite when required. It's also better to do that e.g. if you want to use only few features it providers - like grid system.

grabbou avatar Aug 25 '14 21:08 grabbou

Alternatively, you can pull Bootstrap in from npm. If you npm install -S bootstrap, it has the Less source files. Or you can do npm install -S bootstrap-sass for the Sass version.

I didn't want to commit Bootstrap's source to my project, and I wanted to use Sass, so I used npm and wired it up with the following changes:

keystone.js:

keystone.init({
  // ...
  'sass options': {
    includePaths: [
      'node_modules',
      'node_modules/bootstrap-sass/assets/stylesheets'
    ]
  },
  // ...
});

public/styles/site.scss

// ...
@import "bootstrap";
// ...

whastings avatar Jun 29 '15 19:06 whastings

from the bower home page: ...psst! While Bower is maintained, we recommend using Yarn and Webpack for front-end projects

phamdt avatar Dec 12 '17 16:12 phamdt