blob: b8aefa087b0226dafc124215f754f5d047b8fb0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
const {nanoid} = require('nanoid');
module.exports = function(grunt) {
var website = {};
var token = nanoid(60).toLocaleLowerCase().replace(/[_-]+/g, '');
website['static/js/script-' + token + '.min.js'] = ['static/js/script.js'];
grunt.config.set('uglify', {
// Minify `script.js` file into `script.min.js`
prod: {
options: {
mangle: {
reserved: [
'jQuery',
'fancybox'
]
}
},
files: website
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
};
|