Skip to content

Why use randToken when generating style.min.css file? #732

@xandery-geek

Description

@xandery-geek

Hello, I am confused about why use a random filename for the generated style.min.css/script.min.js file in head.ejs/script.ejs?

I manage the theme code with git. Once rebuilding the theme code, the filename of style.min.css and script.min.js would be changed, which has caused some inconvenience to me.

The related code is in tranquilpeak\tasks\config\cssmin.js

var randToken = require('rand-token');

module.exports = function(grunt) {
  grunt.config.set('cssmin', {
    // Minify `style.css` file into `style.min.css`
    prod: {
      files: [{
        expand: true,
        cwd: 'source/assets/css',
        src: ['style.css'],
        dest: 'source/assets/css',
        ext: '-' + randToken.generate(60).toLocaleLowerCase() + '.min.css'
      }]
    }
  });
  grunt.loadNpmTasks('grunt-contrib-cssmin');
};

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions