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

yeoman build fails unless at least one usemin block is present #247

Closed
addyosmani opened this issue Aug 23, 2012 · 6 comments · Fixed by #253
Closed

yeoman build fails unless at least one usemin block is present #247

addyosmani opened this issue Aug 23, 2012 · 6 comments · Fixed by #253
Assignees
Labels
Milestone

Comments

@addyosmani
Copy link
Member

Requires confirmation from someone else, but: If you remove all usemin blocks from your index.html file and attempt to build it currently chokes with:

Running "rjs" task
No module or single entry point found in rjs configuration, bypassing the task...
>> No "concat" targets found.
<WARN> Task "concat" failed. Use --force to continue. </WARN>

To reproduce, just replace your existing index.html file with this:

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <title></title>
        <meta name="description" content=""/>
        <meta name="viewport" content="width=device-width"/>

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->


        <link rel="stylesheet" href="styles/main.css"/>
        <script src="scripts/vendor/modernizr.min.js"></script>
    </head>
    <body>
    <div class="container" style="margin-top:50px">
        <div class="hero-unit">
            <h1>Cheerio!</h1>
            <p>You now have</p>
            <ul>
                <li>HTML5 Boilerplate</li>
                <li>Twitter Bootstrap</li>
                <li>Twitter Bootstrap plugins</li>
                <li>RequireJS</li>
                <li>Support for ES6 Modules</li>
            </ul>
            <p>installed.</p>
            <h3>Enjoy coding! - Yeoman</h3>
        </div>
    </div>

        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
        <![endif]-->

        <!-- Add your site or application content here -->

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="scripts/vendor/jquery.min.js"><\/script>')</script>


        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
            (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
            g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
            s.parentNode.insertBefore(g,s)}(document,'script'));
        </script>


    </body>
</html>
@jamessun
Copy link

I get the same error if I run yeoman init in a new directory and answer N to all of the prompts -- Twitter Bootstrap for Compass, Twitter Bootstrap plugins, RequireJS, ECMAScript 6.

@addyosmani
Copy link
Member Author

I've been running more tests and I'm almost certain this is to do with the usemin handlers. If you include even one around a block it'll pass the build without issue, but exclude and it'll fail.

I know @mklabs is probably swamped, but just cc'ing in. We can workaround this issue in our boilerplates by wrapping something like modernizr in a usemin block, but ideally they shouldn't be required.

@sindresorhus
Copy link
Member

I can take a look at this.

@ghost ghost assigned sindresorhus Aug 23, 2012
@addyosmani
Copy link
Member Author

Would appreciate that, @sindresorhus!

@mklabs
Copy link
Contributor

mklabs commented Aug 23, 2012

Maybe we should ensure the concat task config is always present, even if it's just {}. (assuming it'll be the same error after on min task)

If there is no usemin block, concat / min tasks can still be used, but currently it assumes manual tweak of the Gruntfile.

@xtianus79
Copy link

any update to this. getting the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants