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

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

Open
xandery-geek opened this issue Jan 2, 2024 · 0 comments
Open

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

xandery-geek opened this issue Jan 2, 2024 · 0 comments
Assignees

Comments

@xandery-geek
Copy link

xandery-geek commented Jan 2, 2024

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');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants