When I use Yo to test Backbone webapp, I get thie error:Running "useminPrepare:html" (useminPrepare) task
Fatal error: require.js blocks are no more supported.
According to the discuss in grunt-usemin, I update Gruntfile.js with requirejs.dis.options:
Insert the following options:,
include: '../bower_components/requirejs/require',
mainConfigFile: yeomanConfig.app + '/scripts/main.js',
out: yeomanConfig.dist + '/scripts/app.min.js'
Then update index.html in app category from<!-- build:js scripts/main.js -->
<script data-main="scripts/main" src="bower_components/requirejs/require.js"></script>
<!-- endbuild -->
</code>
to
<code>
<!-- REMOVE THIS AFTER
grunt build` –>
<script data-main=”scripts/config” src=”bower_components/requirejs/require.js”></script>
<!-- UNCOMMENT THIS AFTER `grunt build` -->
<!-- <script src="scripts/app.min.js"></script> -->
`
The problem should be resolved.
And after build app to dist category, don’t forget to change index.html, use app.min.js to replace requirejs/require.js.