251 lines
8.3 KiB
JavaScript
251 lines
8.3 KiB
JavaScript
var jsCompatibilty = [
|
|
'node_modules/promise-polyfill/dist/polyfill.min.js',
|
|
'node_modules/es6-promise/dist/es6-promise.min.js'
|
|
]
|
|
|
|
var jsMain = [
|
|
// 'node_modules/sweetalert2/dist/sweetalert2.all.min.js',
|
|
'node_modules/inputmask/dist/min/jquery.inputmask.bundle.min.js',
|
|
/* 'node_modules/summernote/dist/summernote.min.js',
|
|
'node_modules/summernote/dist/lang/summernote-fr-FR.min.js',
|
|
*/
|
|
// 'node_modules/@activix/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',
|
|
// 'node_modules/@activix/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js',
|
|
'node_modules/bootstrap-fileinput/js/plugins/piexif.min.js',
|
|
'node_modules/bootstrap-fileinput/js/plugins/sortable.min.js',
|
|
// 'node_modules/bootstrap-slider/dist/bootstrap-slider.min.js',
|
|
// 'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
|
// 'node_modules/jQuery-QueryBuilder/dist/js/jquery-builder.standalone.min.js',
|
|
/* 'node_modules/jQuery-QueryBuilder/dist/i18n/query-builder.fr.js', */
|
|
/* 'node_modules/isotope-layout/dist/isotope.pkgd.min.js', */
|
|
'node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js',
|
|
'node_modules/wew.js/dist/wew.min.js',
|
|
'node_modules/jquery.are-you-sure/jquery.are-you-sure.js',
|
|
/* 'node_modules/letteringjs/jquery.lettering.js', */
|
|
/* 'node_modules/textillate/jquery.textillate.js', */
|
|
'node_modules/jqtree/tree.jquery.js',
|
|
'node_modules/numeral/min/numeral.min.js',
|
|
'node_modules/numeral/min/locales/fr.min.js',
|
|
'build/js/include/plugins/jquery.hcaptions.js',
|
|
'build/js/include/url_on_tab.js',
|
|
'build/js/include/set_options.js',
|
|
// 'build/js/include/confirm.js',
|
|
'build/js/include/appender.js',
|
|
'build/js/include/app.js',
|
|
]
|
|
|
|
var cssMain = [
|
|
// 'node_modules/sweetalert2/dist/sweetalert2.min.css',
|
|
'node_modules/inputmask/css/inputmask.css',
|
|
// 'node_modules/summernote/dist/summernote.css',
|
|
'node_modules/@activix/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css',
|
|
// 'node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css',
|
|
// 'node_modules/jQuery-QueryBuilder/dist/css/query-builder.default.min.css',
|
|
'node_modules/animate.css/animate.min.css',
|
|
'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css',
|
|
'node_modules/jqtree/jqtree.css',
|
|
// 'build/css/modal-option.css',
|
|
'build/css/shadow.css',
|
|
// 'build/css/utility.css',
|
|
'build/css/main.css'
|
|
]
|
|
|
|
var jsDataTables = [
|
|
'node_modules/jszip/dist/jszip.min.js',
|
|
'node_modules/pdfmake/build/pdfmake.min.js',
|
|
'node_modules/pdfmake/build/vfs_fonts.js',
|
|
'node_modules/datatables/media/js/jquery.dataTables.min.js',
|
|
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js',
|
|
'node_modules/datatables.net-autofill/js/autoFill.min.js',
|
|
'node_modules/datatables.net-autofill/js/autoFill.bootstrap.min.js',
|
|
'node_modules/datatables.net-buttons/js/dataTables.buttons.min.js',
|
|
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js',
|
|
'node_modules/datatables.net-buttons/js/buttons.html5.min.js',
|
|
'node_modules/datatables.net-buttons/js/buttons.print.min.js',
|
|
'node_modules/datatables.net-buttons/js/buttons.colVis.min.js',
|
|
'node_modules/datatables.net-colreorder/js/dataTables.colReorder.min.js',
|
|
'node_modules/datatables.net-colreorder-bs4/js/dataTables.colReorder-bs4.min.js',
|
|
'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js',
|
|
'node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.min.js',
|
|
'node_modules/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min.js',
|
|
'node_modules/datatables.net-fixedcolumns-bs4/js/fixedColumns.bootstrap4.min.js',
|
|
'node_modules/datatables.net-keytable/js/dataTables.keyTable.min.js',
|
|
'node_modules/datatables.net-keytable-bs4/js/keyTable.bootstrap4.min.js',
|
|
'node_modules/datatables.net-responsive/js/dataTables.responsive.min.js',
|
|
'node_modules/datatables.net-rowreorder/js/dataTables.rowReorder.min.js',
|
|
'node_modules/datatables.net-rowreorder-bs4/js/dataTables.rowReorder.botstrap4.min.js',
|
|
'node_modules/datatables.net-scroller/js/dataTables.scroller.min.js',
|
|
'node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.min.js',
|
|
'node_modules/datatables.net-select/js/dataTables.select.min.js',
|
|
'node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js',
|
|
'node_modules/yadcf/jquery.dataTables.yadcf.js',
|
|
'build/js/modal.js',
|
|
'build/js/datatables.js',
|
|
];
|
|
|
|
var cssDataTables = [
|
|
// 'node_modules/datatables/media/css/jquery.dataTables.min.css',
|
|
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css',
|
|
'node_modules/dataTables.net-buttons-bs4/css/buttons.bootstrap4.min.css',
|
|
'node_modules/datatables.net-autofill/css/autoFill.bootstrap.min.css',
|
|
'node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css',
|
|
'node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css',
|
|
'node_modules/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css',
|
|
'node_modules/datatables.net-keytable-bs4/css/keyTable.bootstrap4.min.css',
|
|
'node_modules/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css',
|
|
'node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css',
|
|
'node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css',
|
|
'node_modules/yadcf/jquery.dataTables.yadcf.css',
|
|
'build/dataTables.bootstrap.min.css',
|
|
];
|
|
|
|
var jsCalendar = [
|
|
'node_modules/fullcalendar/dist/fullcalendar.min.js',
|
|
'node_modules/fullcalendar/dist/locale/fr.js'
|
|
]
|
|
|
|
var cssCalendar = [
|
|
'node_modules/fullcalendar/dist/fullcalendar.min.css',
|
|
]
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
uglify: {
|
|
options: {
|
|
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
|
|
nameCache: 'built/<%= pkg.name %>.json'
|
|
},
|
|
build: {
|
|
files: [
|
|
{
|
|
'public/js/main.min.js': jsMain,
|
|
'public/js/datatables.min.js': jsDataTables,
|
|
'public/js/calendar.min.js': jsCalendar
|
|
},
|
|
{
|
|
expand: true,
|
|
cwd: 'build/js/modules',
|
|
src: '**/*.js',
|
|
dest: 'public/js',
|
|
rename: function (dest, src) {
|
|
return dest + '/' + src.replace('.js', '.min.js');
|
|
}
|
|
},
|
|
]
|
|
},
|
|
},
|
|
eslint: {
|
|
target: ['build/js/*']
|
|
},
|
|
webstandards: {
|
|
'src': ['build/js/*']
|
|
},
|
|
concat: {
|
|
options: {
|
|
separator: '\n'
|
|
},
|
|
mainjs: {
|
|
src: jsMain,
|
|
dest: 'public/js/main.min.js'
|
|
},
|
|
maincss: {
|
|
src: cssMain,
|
|
dest: 'public/css/main.min.css'
|
|
},
|
|
datatablesjs: {
|
|
src: jsDataTables,
|
|
dest: 'public/js/datatables.min.js'
|
|
},
|
|
datatablescss: {
|
|
src: cssDataTables,
|
|
dest: 'public/css/datatables.min.css'
|
|
},
|
|
calendarjs: {
|
|
src: jsCalendar,
|
|
dest: 'public/js/calendar.min.js'
|
|
},
|
|
calendarcss: {
|
|
src: cssCalendar,
|
|
dest: 'public/css/calendar.min.css'
|
|
}
|
|
},
|
|
cssmin: {
|
|
options: {
|
|
shorthandCompacting: false,
|
|
roundingPrecision: -1
|
|
},
|
|
target: {
|
|
files: [
|
|
{
|
|
'public/css/main.min.css': cssMain
|
|
},
|
|
]
|
|
}
|
|
},
|
|
copy: {
|
|
main: {
|
|
files: [
|
|
{
|
|
expand: true,
|
|
cwd: 'node_modules/bootstrap/dist/fonts/',
|
|
src: ['**'],
|
|
dest: 'public/fonts/'
|
|
},
|
|
{
|
|
expand: true,
|
|
cwd: 'node_modules/font-awesome/fonts/',
|
|
src: ['**'],
|
|
dest: 'public/fonts/'
|
|
},
|
|
{
|
|
expand: true,
|
|
cwd: 'node_modules/summernote/dist/font/',
|
|
src: ['**'],
|
|
dest: 'public/css/font/'
|
|
},
|
|
{
|
|
expand: true,
|
|
cwd: 'node_modules/datatables/media/images/',
|
|
src: ['**'],
|
|
dest: 'public/images/'
|
|
},
|
|
{
|
|
expand: true,
|
|
cwd: 'build/img/',
|
|
src: ['**'],
|
|
dest: 'public/img/'
|
|
},
|
|
],
|
|
}
|
|
},
|
|
watch: {
|
|
dist: {
|
|
files: [
|
|
'build/*',
|
|
],
|
|
tasks: ['concat', 'copy']
|
|
}
|
|
},
|
|
});
|
|
|
|
// Load the plugin that provides the "uglify" task.
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
grunt.loadNpmTasks('grunt-contrib-handlebars');
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
grunt.loadNpmTasks('grunt-eslint');
|
|
grunt.loadNpmTasks('grunt-webstandards');
|
|
|
|
// Default task(s).
|
|
grunt.registerTask('default', ['uglify', 'concat', 'cssmin', 'copy']);
|
|
grunt.registerTask('js', ['uglify']);
|
|
grunt.registerTask('css', ['cssmin', 'copy']);
|
|
grunt.registerTask('dev', ['concat', 'copy']);
|
|
grunt.registerTask('lint', ['eslint']);
|
|
grunt.registerTask('webstandards', ['webstandards']);
|
|
};
|