mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +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({
|
grunt.initConfig({
|
||||||
|
|
||||||
clean: {
|
clean: {
|
||||||
build: ['public/build']
|
build: ['build']
|
||||||
},
|
},
|
||||||
|
|
||||||
uglify: {
|
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: {
|
nodemon: {
|
||||||
dev: {
|
dev: {
|
||||||
ignoredFiles: ['public/*', 'Gruntfile.js', 'views/*', 'build/*'] // Do not work!
|
ignoredFiles: ['public/*', 'Gruntfile.js', 'views/*', 'build/*'] // Do not work!
|
||||||
@@ -134,8 +149,8 @@ module.exports = function(grunt) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Register tasks.
|
// Register tasks.
|
||||||
grunt.registerTask('build:prod', ['clean:build', 'uglify', 'stylus', 'cssmin']);
|
grunt.registerTask('build:prod', ['clean:build', 'uglify', 'stylus', 'cssmin', 'hashres']);
|
||||||
grunt.registerTask('build:dev', ['clean:build', 'stylus', 'cssmin']);
|
grunt.registerTask('build:dev', ['clean:build', 'stylus', 'cssmin', 'hashres']);
|
||||||
|
|
||||||
grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]);
|
grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]);
|
||||||
|
|
||||||
@@ -147,5 +162,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-nodemon');
|
grunt.loadNpmTasks('grunt-nodemon');
|
||||||
grunt.loadNpmTasks('grunt-concurrent');
|
grunt.loadNpmTasks('grunt-concurrent');
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
|
grunt.loadNpmTasks('grunt-hashres');
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
"grunt-contrib-clean": "~0.5.0",
|
"grunt-contrib-clean": "~0.5.0",
|
||||||
"grunt-contrib-cssmin": "~0.6.1",
|
"grunt-contrib-cssmin": "~0.6.1",
|
||||||
"grunt-contrib-watch": "~0.5.x",
|
"grunt-contrib-watch": "~0.5.x",
|
||||||
|
"grunt-hashres": "~0.3.2",
|
||||||
"grunt-nodemon": "~0.1.1",
|
"grunt-nodemon": "~0.1.1",
|
||||||
"grunt-concurrent": "~0.3.1",
|
"grunt-concurrent": "~0.3.1",
|
||||||
"bower": "~1.2.4",
|
"bower": "~1.2.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user