Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add 'banner" with date/time to files optimized by RequireJS

In grunt, you can add a "banner" to files that have been concatenated and minfied like so:

module.exports = function (grunt) {
  grunt.initConfig({
    cssmin: {
      add_banner: {
        options: {
          banner: '/* My minified css file */'
        },
        files: {
          'dist/css/dist.min.css': ["bower_components/bootstrap/dist/css/bootstrap.css", "tmp/css/dist.css"]
        }
      }
    }
  })
}

Is there a way to do a similar thing with RequireJS? I'ved looked in the example build file provided in the RequireJS documentation, but have not been able to find any such option.

like image 400
fraxture Avatar asked Dec 04 '25 05:12

fraxture


1 Answers

You could use the wrap option of the r.js configuration:

({
    ...
    "wrap": {
        "start": "/* My minified css file */\n",
        "end": ""
    },
    ...
})
like image 53
Nikos Paraskevopoulos Avatar answered Dec 06 '25 04:12

Nikos Paraskevopoulos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!