2016-03-08 16:02:34 +00:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
appDir: 'app/Resources/static',
|
|
|
|
buildDir: 'web/bundles/wallabagcore',
|
|
|
|
|
|
|
|
postcss: {
|
|
|
|
material: {
|
|
|
|
options: {
|
|
|
|
map: {
|
2016-06-09 17:02:38 +00:00
|
|
|
inline: false,
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
processors: [
|
|
|
|
require('pixrem')(),
|
2016-06-09 17:02:38 +00:00
|
|
|
require('autoprefixer')({ browsers: 'last 2 versions' }),
|
|
|
|
require('cssnano')(),
|
|
|
|
],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
src: '<%= buildDir %>/material.css',
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/themes/material/css/style.min.css',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
baggy: {
|
|
|
|
options: {
|
|
|
|
map: {
|
2016-06-09 17:02:38 +00:00
|
|
|
inline: false,
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
processors: [
|
|
|
|
require('pixrem')(),
|
2016-06-09 17:02:38 +00:00
|
|
|
require('autoprefixer')({ browsers: 'last 2 versions' }),
|
|
|
|
require('cssnano')(),
|
|
|
|
],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
src: '<%= buildDir %>/baggy.css',
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/themes/baggy/css/style.min.css',
|
|
|
|
},
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
concat: {
|
|
|
|
options: {
|
2016-06-09 17:02:38 +00:00
|
|
|
separator: ';',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
jsMaterial: {
|
|
|
|
src: [
|
2016-06-09 17:02:38 +00:00
|
|
|
'<%= appDir %>/themes/material/js/init.js',
|
2016-03-08 16:02:34 +00:00
|
|
|
'<%= appDir %>/themes/_global/js/restoreScroll.js',
|
2016-09-02 07:52:15 +00:00
|
|
|
'node_modules/jquery.tinydot/src/jquery.tinydot.js',
|
2016-03-08 16:02:34 +00:00
|
|
|
],
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/material.js',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
jsBaggy: {
|
|
|
|
src: [
|
|
|
|
'<%= appDir %>/themes/baggy/js/init.js',
|
|
|
|
'<%= appDir %>/themes/_global/js/restoreScroll.js',
|
|
|
|
'<%= appDir %>/themes/baggy/js/autoClose.js',
|
|
|
|
'<%= appDir %>/themes/baggy/js/autoCompleteTags.js',
|
|
|
|
'<%= appDir %>/themes/baggy/js/closeMessage.js',
|
|
|
|
'<%= appDir %>/themes/baggy/js/popupForm.js',
|
2016-06-09 17:02:38 +00:00
|
|
|
// Save link is no more used for now
|
|
|
|
// '<%= appDir %>/themes/baggy/js/saveLink.js',
|
2016-03-08 16:02:34 +00:00
|
|
|
],
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/baggy.js',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
cssMaterial: {
|
|
|
|
src: [
|
|
|
|
'node_modules/materialize-css/bin/materialize.css',
|
2016-06-09 17:02:38 +00:00
|
|
|
'<%= appDir %>/themes/material/css/*.css',
|
2016-03-08 16:02:34 +00:00
|
|
|
],
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/material.css',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
cssBaggy: {
|
|
|
|
src: [
|
2016-06-09 17:02:38 +00:00
|
|
|
'<%= appDir %>/themes/baggy/css/*.css',
|
2016-03-08 16:02:34 +00:00
|
|
|
],
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/baggy.css',
|
|
|
|
},
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
browserify: {
|
|
|
|
'<%= buildDir %>/material.browser.js': ['<%= buildDir %>/material.js'],
|
2016-06-09 17:02:38 +00:00
|
|
|
'<%= buildDir %>/baggy.browser.js': ['<%= buildDir %>/baggy.js'],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
uglify: {
|
|
|
|
material: {
|
|
|
|
files: {
|
|
|
|
'<%= buildDir %>/themes/material/js/material.min.js':
|
2016-06-09 17:02:38 +00:00
|
|
|
['<%= buildDir %>/material.browser.js'],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
options: {
|
|
|
|
sourceMap: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
baggy: {
|
|
|
|
files: {
|
|
|
|
'<%= buildDir %>/themes/baggy/js/baggy.min.js':
|
2016-06-09 17:02:38 +00:00
|
|
|
['<%= buildDir %>/baggy.browser.js'],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
options: {
|
|
|
|
sourceMap: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
copy: {
|
|
|
|
pickerjs: {
|
|
|
|
expand: true,
|
|
|
|
cwd: 'node_modules/pickadate/lib',
|
|
|
|
src: 'picker.js',
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
annotator: {
|
|
|
|
expand: true,
|
|
|
|
cwd: 'node_modules/annotator/pkg',
|
|
|
|
src: 'annotator.min.js',
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/themes/_global/js/',
|
|
|
|
},
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
symlink: {
|
|
|
|
baggyfonts: {
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
2016-06-09 17:02:38 +00:00
|
|
|
cwd: '<%= appDir %>/lib/icomoon-bower/',
|
|
|
|
src: 'fonts',
|
|
|
|
dest: '<%= buildDir %>/themes/baggy/',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
2016-06-09 17:02:38 +00:00
|
|
|
cwd: '<%= appDir %>/lib/bower-pt-sans/fonts',
|
|
|
|
src: '*',
|
|
|
|
dest: '<%= buildDir %>/themes/baggy/fonts/',
|
|
|
|
},
|
|
|
|
],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
materialfonts: {
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
2016-06-09 17:02:38 +00:00
|
|
|
cwd: '<%= appDir %>/lib/icomoon-bower/',
|
|
|
|
src: 'fonts',
|
|
|
|
dest: '<%= buildDir %>/themes/material/',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
2016-06-09 17:02:38 +00:00
|
|
|
cwd: 'node_modules/materialize-css/',
|
|
|
|
src: 'font',
|
|
|
|
dest: '<%= buildDir %>/themes/material',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
2016-06-09 17:02:38 +00:00
|
|
|
cwd: '<%= appDir %>/lib/roboto-fontface/fonts/',
|
|
|
|
src: '*',
|
|
|
|
dest: '<%= buildDir %>/themes/material/fonts/roboto/',
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
2016-06-23 20:10:12 +00:00
|
|
|
cwd: '<%= appDir %>/lib/material-design-icons-iconfont/dist/fonts/',
|
2016-06-09 17:02:38 +00:00
|
|
|
src: '*',
|
|
|
|
dest: '<%= buildDir %>/themes/material/fonts/',
|
|
|
|
},
|
|
|
|
],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
pics: {
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
overwrite: true,
|
|
|
|
cwd: '<%= appDir %>/themes/_global/',
|
|
|
|
src: 'img',
|
2016-06-09 17:02:38 +00:00
|
|
|
dest: '<%= buildDir %>/themes/_global/',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
clean: {
|
|
|
|
css: {
|
2016-06-09 17:02:38 +00:00
|
|
|
src: ['<%= buildDir %>/**/*.css'],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
js: {
|
2016-06-09 17:02:38 +00:00
|
|
|
src: ['<%= buildDir %>/**/*.js', '<%= buildDir %>/**/*.map'],
|
2016-03-08 16:02:34 +00:00
|
|
|
},
|
|
|
|
all: {
|
2016-06-09 17:02:38 +00:00
|
|
|
src: ['./<%= buildDir %>'],
|
|
|
|
},
|
|
|
|
},
|
2016-03-08 16:02:34 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
grunt.registerTask(
|
|
|
|
'fonts',
|
|
|
|
'Install fonts',
|
|
|
|
['symlink:baggyfonts', 'symlink:materialfonts']
|
|
|
|
);
|
|
|
|
|
|
|
|
grunt.registerTask(
|
|
|
|
'js',
|
|
|
|
'Build and install js files',
|
|
|
|
['clean:js', 'copy:pickerjs', 'concat:jsMaterial', 'concat:jsBaggy', 'browserify', 'uglify']
|
|
|
|
);
|
|
|
|
|
|
|
|
grunt.registerTask(
|
|
|
|
'default',
|
|
|
|
'Build and install everything',
|
|
|
|
['clean', 'copy:pickerjs', 'concat', 'browserify', 'uglify', 'postcss', 'symlink']
|
|
|
|
);
|
|
|
|
|
|
|
|
grunt.registerTask(
|
|
|
|
'css',
|
|
|
|
'Compiles the stylesheets.',
|
|
|
|
['clean:css', 'concat:cssMaterial', 'concat:cssBaggy', 'postcss']
|
|
|
|
);
|
2016-06-09 17:02:38 +00:00
|
|
|
};
|