javascript - further automation of grunt-require -
short , concise question.
to have requirejs it's job need add [code*] ahead of class make.
define(function(require, exports, module) { 'use strict'; is there straight forward way automatically add ahead of .js file before task:require?
(i don't know if might change answer, use coffeescript setup)
you can make use of onbuildwrite option of require's optimizer:
onbuildwrite: function (modname, path, contents) { return "'use strict'\n" + contents; } this include 'use strict' before each module's define function. if you'd place inside of define call suggest using regex select define(...){ , replace define(...){ + "'use strict'\n"
Comments
Post a Comment