grunt.initConfig({
appDir: 'app/Resources/static',
buildDir: 'web/bundles/wallabagcore',
+ modulesDir: 'node_modules',
postcss: {
material: {
options: {
separator: ';',
},
- jsMaterial: {
- src: [
- '<%= appDir %>/themes/material/js/init.js',
- '<%= appDir %>/themes/_global/js/restoreScroll.js',
- 'node_modules/jquery.tinydot/src/jquery.tinydot.js',
- ],
- dest: '<%= buildDir %>/material.js',
- },
- 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',
- // Save link is no more used for now
- // '<%= appDir %>/themes/baggy/js/saveLink.js',
- ],
- dest: '<%= buildDir %>/baggy.js',
- },
cssMaterial: {
src: [
'node_modules/materialize-css/bin/materialize.css',
},
},
browserify: {
- '<%= buildDir %>/material.browser.js': ['<%= buildDir %>/material.js'],
- '<%= buildDir %>/baggy.browser.js': ['<%= buildDir %>/baggy.js'],
+ dist: {
+ files: {
+ '<%= buildDir %>/material.browser.js': ['<%= appDir %>/themes/material/js/init.js'],
+ '<%= buildDir %>/baggy.browser.js': ['<%= appDir %>/themes/baggy/js/init.js']
+ }
+ },
+ options: {
+ sourceType: "module",
+ transform: [
+ ["babelify", {
+ presets: ["es2015"]
+ }], ["browserify-shim", {
+ "jquery": {
+ "exports": "$"
+ },
+ "materialize": "materialize",
+ "jquery-ui": {
+ "depends": "jquery",
+ "exports": null
+ }
+ }]
+ ],
+ browserifyOptions: {
+ browser: {
+ "jQuery": "./node_modules/jquery/dist/jquery.js",
+ "jquery.tinydot": "./node_modules/jquery.tinydot/src/jquery.tinydot.js",
+ "jquery.ui": "./node_modules/jquery-ui-browserify/dist/jquery-ui.js"
+ }
+ }
+ }
+
},
uglify: {
material: {
copy: {
pickerjs: {
expand: true,
- cwd: 'node_modules/pickadate/lib',
+ cwd: '<%= modulesDir %>/pickadate/lib',
src: 'picker.js',
dest: '<%= buildDir %>',
},
annotator: {
expand: true,
- cwd: 'node_modules/annotator/pkg',
+ cwd: '<%= modulesDir %>/annotator/pkg',
src: 'annotator.min.js',
dest: '<%= buildDir %>/themes/_global/js/',
},
{
expand: true,
overwrite: true,
- cwd: '<%= appDir %>/lib/icomoon-bower/',
- src: 'fonts',
- dest: '<%= buildDir %>/themes/baggy/',
+ cwd: '<%= modulesDir %>/icomoon-free-npm/Font',
+ src: 'IcoMoon-Free.ttf',
+ dest: '<%= buildDir %>/themes/baggy/fonts/',
},
{
expand: true,
overwrite: true,
- cwd: '<%= appDir %>/lib/bower-pt-sans/fonts',
+ cwd: '<%= modulesDir %>/ptsans-npm-webfont/fonts',
+ src: '*',
+ dest: '<%= buildDir %>/themes/baggy/fonts/',
+ },
+ {
+ expand: true,
+ overwrite: true,
+ cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/',
src: '*',
dest: '<%= buildDir %>/themes/baggy/fonts/',
},
{
expand: true,
overwrite: true,
- cwd: '<%= appDir %>/lib/icomoon-bower/',
- src: 'fonts',
- dest: '<%= buildDir %>/themes/material/',
+ cwd: '<%= modulesDir %>/icomoon-free-npm/Font',
+ src: 'IcoMoon-Free.ttf',
+ dest: '<%= buildDir %>/themes/material/fonts',
},
{
expand: true,
overwrite: true,
- cwd: 'node_modules/materialize-css/',
+ cwd: '<%= modulesDir %>/materialize-css/',
src: 'font',
dest: '<%= buildDir %>/themes/material',
},
{
expand: true,
overwrite: true,
- cwd: '<%= appDir %>/lib/roboto-fontface/fonts/',
+ cwd: '<%= modulesDir %>/roboto-fontface/fonts/Roboto',
src: '*',
- dest: '<%= buildDir %>/themes/material/fonts/roboto/',
+ dest: '<%= buildDir %>/themes/material/fonts/',
},
{
expand: true,
overwrite: true,
- cwd: '<%= appDir %>/lib/material-design-icons-iconfont/dist/fonts/',
+ cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/',
src: '*',
dest: '<%= buildDir %>/themes/material/fonts/',
},
grunt.registerTask(
'js',
'Build and install js files',
- ['clean:js', 'copy:pickerjs', 'concat:jsMaterial', 'concat:jsBaggy', 'browserify', 'uglify']
+ ['clean:js', 'copy:pickerjs', 'browserify', 'uglify']
);
grunt.registerTask(