mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
add hash to build files & correct minor fix
This commit is contained in:
22
Gruntfile.js
22
Gruntfile.js
@@ -5,7 +5,7 @@ module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
|
||||
clean: {
|
||||
build: ['public/build']
|
||||
build: ['build']
|
||||
},
|
||||
|
||||
uglify: {
|
||||
@@ -108,6 +108,21 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
// UPDATE IT!
|
||||
hashres: {
|
||||
build: {
|
||||
options: {
|
||||
fileNameFormat: '${name}-${hash}.${ext}'
|
||||
},
|
||||
src: [
|
||||
'build/*.js', 'build/*.css',
|
||||
'build/bower_components/bootstrap/docs/assets/css/*.css',
|
||||
'build/bower_components/habitrpg-shared/dist/*.css'
|
||||
],
|
||||
dest: 'make-sure-i-do-not-exist'
|
||||
}
|
||||
},
|
||||
|
||||
nodemon: {
|
||||
dev: {
|
||||
ignoredFiles: ['public/*', 'Gruntfile.js', 'views/*', 'build/*'] // Do not work!
|
||||
@@ -134,8 +149,8 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
// Register tasks.
|
||||
grunt.registerTask('build:prod', ['clean:build', 'uglify', 'stylus', 'cssmin']);
|
||||
grunt.registerTask('build:dev', ['clean:build', 'stylus', 'cssmin']);
|
||||
grunt.registerTask('build:prod', ['clean:build', 'uglify', 'stylus', 'cssmin', 'hashres']);
|
||||
grunt.registerTask('build:dev', ['clean:build', 'stylus', 'cssmin', 'hashres']);
|
||||
|
||||
grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]);
|
||||
|
||||
@@ -147,5 +162,6 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-nodemon');
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-hashres');
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user