X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=Gruntfile.js;h=86612dc4b2385d626a85c13f2f264db015612f95;hb=24add95e9eaa1211655aff6d3d06c30e94252bcc;hp=c741954973cc3321b78c893f3c92f32385e6b745;hpb=b1c9b78203710ad4cfd601b06bf1ec384595b3f3;p=github%2Fwallabag%2Fwallabag.git diff --git a/Gruntfile.js b/Gruntfile.js index c7419549..86612dc4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,6 +4,7 @@ module.exports = function (grunt) { grunt.initConfig({ appDir: 'app/Resources/static', buildDir: 'web/bundles/wallabagcore', + modulesDir: 'node_modules', postcss: { material: { @@ -41,26 +42,6 @@ module.exports = function (grunt) { options: { separator: ';', }, - jsMaterial: { - src: [ - '<%= appDir %>/themes/material/js/init.js', - '<%= appDir %>/themes/_global/js/restoreScroll.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', @@ -76,8 +57,37 @@ module.exports = function (grunt) { }, }, 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: { @@ -102,13 +112,13 @@ module.exports = function (grunt) { 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/', }, @@ -119,14 +129,21 @@ module.exports = function (grunt) { { 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/', }, @@ -137,28 +154,28 @@ module.exports = function (grunt) { { 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/', }, @@ -198,7 +215,7 @@ module.exports = function (grunt) { 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(