I'm aware that I can create a custom build build of Modernizr to detect the features I care about. But is there a way to use Modernizr installed with Bower to detect a specific feature or set of features (such as SVG support) without including the entire library?
Basically when I do
bower install modernizr
I will get the entire library which is more than I need.
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user's browser.
Modernizr is a JavaScript library that detects the features available in a user's browser. This lets web pages avoid unsupported features by informing the user their browser isn't supported or loading a polyfill.
Enter Bower, a package manager that makes it easy to manage all your application’s front-end dependencies. In this blog post you are going to learn how to get up and running with Bower. You’ll start by installing the Bower command-line utility and then go on to learn about the various commands that are available for managing packages.
The bower.json file is actually used to define a Bower package, so in effect you’re creating your own package that contains all of the dependencies for your application. The properties used in this example are explained below. name – The name of your application/package. version – A version number for your application/package.
Both npm and Bower work with specialized manifest files that contain information about a project and a list of packages it uses. With npm projects that file is named “package.json” and in Bower projects it’s named “bower.json”.
Mac users, because we’re using the -g flag to install Bower globally remember you’ll likely need to include sudo at the start of the command, then enter your password when prompted. Both npm and Bower work with specialized manifest files that contain information about a project and a list of packages it uses.
That's not the responsibility of Bower.
You can use grunt-modernizr to detect which tests you need and build a custom Modernizr version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With