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

How do I include Modernizr so that it will work in the dist version? #47

Open
vikeri opened this issue Jan 19, 2015 · 0 comments
Open

Comments

@vikeri
Copy link

vikeri commented Jan 19, 2015

I wan't to use Modernizr to determine if the client can run famo.us, I therefore downloaded a beta version of Modernizer as suggested here: http://stackoverflow.com/questions/25261412/detect-whether-the-browser-supports-famo-us

I saved that to src/modernizr.js and added it so the top of my main.js looks like this:

 /* globals define */
define(function(require, exports, module) {
    'use strict';
     require(['modernizr'],function(){
        if(!Modernizr.testAllProps('transformStyle', 'preserve-3d')){ //Send user to static if Famo.us not supported
            window.location.replace("/components/1.html");
        }
 });

This works well when I use the dev version grunt serve, but fails to load when I use only grunt to generate the production version. Any ideas why?

The error I get in the console is the following:

Error: undefined missing modernizr

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

1 participant