Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bower.json main section is "illegal" to bower spec #7

Closed
stefan-schweiger opened this issue Jul 8, 2015 · 6 comments
Closed

bower.json main section is "illegal" to bower spec #7

stefan-schweiger opened this issue Jul 8, 2015 · 6 comments

Comments

@stefan-schweiger
Copy link

From the bower.json spec:

[...] Only one file per filetype.

[...]

Image and font files may be used or referenced within the JS or Sass files, but are not main files as they are not entry-points.

  • Use source files with module exports and imports over pre-built distribution files.
  • Do not include minified files.
  • Do not include assets files like images, fonts, audio, or video.
  • Filenames should not be versioned (Bad: package.1.1.0.js; Good: package.js).
  • Globs like js/*.js are not allowed

Because of this with your current configuration wiredep always includes the normal an the minfied css file.

So the main section should only include the css file:

"main": [
    "css/materialdesignicons.css",
]
@stefan-schweiger
Copy link
Author

OK, after thinking more about this and looking how other font libraries, like Font Aweseom, handle their bower.json files it kind of makes sense to include the font files and the materialdesignicons.scss. Because else it will be cumbersome to handle the assets and styles dynamically with gulp/grunt tasks.

But I still would suggest to only include one file per filetype, no minified file and no globs.

"main": [
    "css/materialdesignicons.css",
    "scss/materialdesignicons.scss",
    "fonts/materialdesignicons-webfont.eot",
    "fonts/materialdesignicons-webfont.svg",
    "fonts/materialdesignicons-webfont.ttf",
    "fonts/materialdesignicons-webfont.woff",
    "fonts/materialdesignicons-webfont.woff2"
]

@tagliala
Copy link

tagliala commented Jul 8, 2015

AFAIK, in the new bower specifications, if there is a .less or .scss file, you should not include the .css

People needing .css should override their bower.json

Refers to FortAwesome/Font-Awesome#6227
http://blog.getbootstrap.com/2015/06/15/bootstrap-3-3-5-released/#wiredep-and-bower
bower/spec#47

Hope it helps

@stefan-schweiger
Copy link
Author

@tagliala thanks for pointing this out!

I guess many people are using bower with wiredep, so we should probably not break this until the issues are resolved. But still having the min.css in there also messes with wiredep, so this still not belongs in there.

@julienpa
Copy link

+1 on improving this. By now, I am relying on Bower's overrides section, with something like that:

"overrides": {
  "mdi": {
    "main": [
      "scss/materialdesignicons.scss"
    ]
  }
}

@Templarian
Copy link
Owner

This change will be in the next release by the way. Was an oversight it didn't get into the 1.6.50 release.

@Templarian
Copy link
Owner

https://github.com/Templarian/MaterialDesign-Webfont/blob/master/bower.json

I think v1.7.12 fixed this. Let me know if there are any other changes needed.

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

No branches or pull requests

4 participants