2018-10-13 11:09:02 +00:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
jshint: {
|
|
|
|
all: ['Gruntfile.js', 'src/js/app.js']
|
|
|
|
},
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
cssmin: {
|
|
|
|
build: {
|
|
|
|
files: {
|
|
|
|
'static/app/app.css': [
|
|
|
|
'src/css/app.css'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
uglify: {
|
|
|
|
options: {
|
|
|
|
preserveComments: false,
|
|
|
|
compress: true
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
files: {
|
|
|
|
'static/app/app.js': [
|
|
|
|
'src/js/app.js'
|
|
|
|
],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
watch: {
|
|
|
|
css: {
|
|
|
|
files: [
|
|
|
|
'src/css/app.css'
|
|
|
|
],
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
tasks: ['cssmin']
|
|
|
|
},
|
|
|
|
scripts: {
|
|
|
|
files: [
|
|
|
|
'src/js/app.js',
|
|
|
|
],
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
tasks: ['uglify']
|
|
|
|
}
|
|
|
|
},
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
copy: {
|
|
|
|
main: {
|
|
|
|
files: [
|
|
|
|
{expand: true, cwd: 'node_modules/@fortawesome/fontawesome-free', src: ['css/**', 'js/**'], dest: 'static/fontawesome'},
|
|
|
|
{expand: true, cwd: 'node_modules/bootstrap/dist', src: ['**'], dest: 'static/bootstrap'},
|
|
|
|
{expand: true, cwd: 'node_modules/clipboard/dist', src: ['**'], dest: 'static/clipboardjs'},
|
2018-11-15 11:10:23 +00:00
|
|
|
{expand: true, cwd: 'node_modules/video.js/dist', src: ['video.min.js', 'video-js.min.css'], dest: 'static/videojs'},
|
2018-10-13 11:09:02 +00:00
|
|
|
{expand: true, cwd: 'node_modules/highlightjs', src: ['styles/**/*', 'highlight.pack.min.js'], dest: 'static/highlightjs'},
|
|
|
|
{expand: true, cwd: 'node_modules/jquery/dist', src: ['jquery.min.js'], dest: 'static/jquery'}
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
zip: {
|
2018-10-13 23:18:02 +00:00
|
|
|
'release.zip': [
|
|
|
|
'app/**/*',
|
|
|
|
'bin/**/*',
|
|
|
|
'bootstrap/**/*',
|
2018-11-11 19:20:38 +00:00
|
|
|
'install/**/*',
|
2018-10-13 23:18:02 +00:00
|
|
|
'logs/**/',
|
|
|
|
'resources/cache',
|
|
|
|
'resources/sessions',
|
|
|
|
'resources/database',
|
2018-11-19 11:19:47 +00:00
|
|
|
'resources/lang/**/*',
|
2018-10-13 23:18:02 +00:00
|
|
|
'resources/templates/**/*',
|
|
|
|
'resources/schemas/**/*',
|
|
|
|
'static/**/*',
|
|
|
|
'vendor/**/*',
|
|
|
|
'.htaccess',
|
|
|
|
'config.example.php',
|
|
|
|
'index.php',
|
|
|
|
'composer.json',
|
|
|
|
'composer.lock'
|
|
|
|
]
|
2018-10-13 11:09:02 +00:00
|
|
|
}
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
});
|
2018-06-02 20:32:14 +00:00
|
|
|
|
2018-10-13 11:09:02 +00:00
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
grunt.registerTask('default', ['jshint', 'cssmin', 'uglify', 'copy']);
|
|
|
|
grunt.registerTask('test', ['jshint']);
|
|
|
|
grunt.registerTask('build-release', ['default', 'zip']);
|
2018-06-02 20:32:14 +00:00
|
|
|
|
|
|
|
};
|