Add basic distribution for accountant web.

This commit is contained in:
Alexis Lahouze 2016-02-18 14:45:11 +01:00
parent dbb67d1285
commit 4ccb9891a8
7 changed files with 89 additions and 6 deletions

View File

@ -57,4 +57,17 @@ module.exports = function(grunt) {
'bgShell:runserver', 'bgShell:runserver',
'watch' 'watch'
]); ]);
grunt.registerTask('dist', [
'wiredep',
'clean:dist',
'useminPrepare',
'copy:dist',
'copy:styles',
'concat:generated',
'cssmin:generated',
'uglify:generated',
'filerev',
'usemin'
]);
}; };

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
module.exports = { module.exports = {
libs: [ dist: [
'<%= accountant.frontend.dist %>' '<%= accountant.frontend.dist %>'
] ]
}; };

View File

@ -1,6 +1,22 @@
'use strict';
module.exports = { module.exports = {
"bootstrap-select.css.map": { dist: {
src: 'bower_components/bootstrap-select/dist/css/bootstrap-select.css.map', files: [{
dest: '<%= paths.frontend_build %>/css/bootstrap-select.css.map' expand: true,
dot: true,
cwd: '<%= accountant.frontend.src %>',
dest: '<%= accountant.frontend.dist %>',
src :[
'*.html',
'views/*.html',
]
}]
}, },
styles: {
expand: true,
cwd: '<%= accountant.frontend.src %>/css',
dest: '.tmp/css',
src: '{,*/}*.css'
}
}; };

17
grunt-config/filerev.js Normal file
View File

@ -0,0 +1,17 @@
'use strict';
module.exports = {
options: {
encoding: 'utf-8',
algorithm: 'md5',
length: 8
},
dist: {
src: [
'<%= accountant.frontend.dist %>/css/*.css',
'<%= accountant.frontend.dist %>/js/*.js',
'!<%= accountant.frontend.dist %>/css/*.map.css',
'!<%= accountant.frontend.dist %>/js/*.map.js'
]
},
};

16
grunt-config/usemin.js Normal file
View File

@ -0,0 +1,16 @@
'use strict';
module.exports = {
html: ['<%= accountant.frontend.dist %>/{,*/}*.html'],
css: ['<%= accountant.frontend.dist %>/css/{,*/}*.css'],
js: ['<%= accountant.frontend.dist %>/js/{,*/}*.js'],
options: {
assetsDir: [
'<%= accountant.frontend.dist %>',
'<%= accountant.frontend.dist %>/css',
],
patterns: {
js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']]
}
}
};

View File

@ -0,0 +1,17 @@
'use strict';
module.exports = {
html: '<%= accountant.frontend.src %>/index.html ',
options: {
dest: '<%= accountant.frontend.dist %>',
flow: {
html: {
steps: {
js: ['concat', 'uglify'],
css: ['cssmin']
},
post: {}
}
}
}
};

View File

@ -6,17 +6,21 @@
"devDependencies": { "devDependencies": {
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-bg-shell": "^2.3.1", "grunt-bg-shell": "^2.3.1",
"grunt-contrib-clean": "^0.7.0", "grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^0.5.1", "grunt-contrib-concat": "^0.5.1",
"grunt-contrib-jshint": "^0.12", "grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "^0.11.1",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "^0.6.1",
"grunt-copy": "^0.1.0", "grunt-copy": "^0.1.0",
"grunt-filerev": "^2.3.1",
"grunt-flake8": "^0.1.3", "grunt-flake8": "^0.1.3",
"grunt-htmllint": "^0.2.7", "grunt-htmllint": "^0.2.7",
"grunt-include-source": "^0.7.1", "grunt-include-source": "^0.7.1",
"grunt-jscs": "^2.7.0", "grunt-jscs": "^2.7.0",
"grunt-newer": "^1.1.1", "grunt-newer": "^1.1.1",
"grunt-shell": "^1.1.2", "grunt-shell": "^1.1.2",
"grunt-usemin": "^3.1.1",
"grunt-wiredep": "^2.0.0", "grunt-wiredep": "^2.0.0",
"jshint-stylish": "^2.1.0", "jshint-stylish": "^2.1.0",
"load-grunt-configs": "^0.4.3", "load-grunt-configs": "^0.4.3",