diff options
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 90 |
1 files changed, 53 insertions, 37 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 8dc5b83b..86612dc4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js | |||
@@ -4,6 +4,7 @@ module.exports = function (grunt) { | |||
4 | grunt.initConfig({ | 4 | grunt.initConfig({ |
5 | appDir: 'app/Resources/static', | 5 | appDir: 'app/Resources/static', |
6 | buildDir: 'web/bundles/wallabagcore', | 6 | buildDir: 'web/bundles/wallabagcore', |
7 | modulesDir: 'node_modules', | ||
7 | 8 | ||
8 | postcss: { | 9 | postcss: { |
9 | material: { | 10 | material: { |
@@ -41,27 +42,6 @@ module.exports = function (grunt) { | |||
41 | options: { | 42 | options: { |
42 | separator: ';', | 43 | separator: ';', |
43 | }, | 44 | }, |
44 | jsMaterial: { | ||
45 | src: [ | ||
46 | '<%= appDir %>/themes/material/js/init.js', | ||
47 | '<%= appDir %>/themes/_global/js/restoreScroll.js', | ||
48 | 'node_modules/jquery.tinydot/src/jquery.tinydot.js', | ||
49 | ], | ||
50 | dest: '<%= buildDir %>/material.js', | ||
51 | }, | ||
52 | jsBaggy: { | ||
53 | src: [ | ||
54 | '<%= appDir %>/themes/baggy/js/init.js', | ||
55 | '<%= appDir %>/themes/_global/js/restoreScroll.js', | ||
56 | '<%= appDir %>/themes/baggy/js/autoClose.js', | ||
57 | '<%= appDir %>/themes/baggy/js/autoCompleteTags.js', | ||
58 | '<%= appDir %>/themes/baggy/js/closeMessage.js', | ||
59 | '<%= appDir %>/themes/baggy/js/popupForm.js', | ||
60 | // Save link is no more used for now | ||
61 | // '<%= appDir %>/themes/baggy/js/saveLink.js', | ||
62 | ], | ||
63 | dest: '<%= buildDir %>/baggy.js', | ||
64 | }, | ||
65 | cssMaterial: { | 45 | cssMaterial: { |
66 | src: [ | 46 | src: [ |
67 | 'node_modules/materialize-css/bin/materialize.css', | 47 | 'node_modules/materialize-css/bin/materialize.css', |
@@ -77,8 +57,37 @@ module.exports = function (grunt) { | |||
77 | }, | 57 | }, |
78 | }, | 58 | }, |
79 | browserify: { | 59 | browserify: { |
80 | '<%= buildDir %>/material.browser.js': ['<%= buildDir %>/material.js'], | 60 | dist: { |
81 | '<%= buildDir %>/baggy.browser.js': ['<%= buildDir %>/baggy.js'], | 61 | files: { |
62 | '<%= buildDir %>/material.browser.js': ['<%= appDir %>/themes/material/js/init.js'], | ||
63 | '<%= buildDir %>/baggy.browser.js': ['<%= appDir %>/themes/baggy/js/init.js'] | ||
64 | } | ||
65 | }, | ||
66 | options: { | ||
67 | sourceType: "module", | ||
68 | transform: [ | ||
69 | ["babelify", { | ||
70 | presets: ["es2015"] | ||
71 | }], ["browserify-shim", { | ||
72 | "jquery": { | ||
73 | "exports": "$" | ||
74 | }, | ||
75 | "materialize": "materialize", | ||
76 | "jquery-ui": { | ||
77 | "depends": "jquery", | ||
78 | "exports": null | ||
79 | } | ||
80 | }] | ||
81 | ], | ||
82 | browserifyOptions: { | ||
83 | browser: { | ||
84 | "jQuery": "./node_modules/jquery/dist/jquery.js", | ||
85 | "jquery.tinydot": "./node_modules/jquery.tinydot/src/jquery.tinydot.js", | ||
86 | "jquery.ui": "./node_modules/jquery-ui-browserify/dist/jquery-ui.js" | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | |||
82 | }, | 91 | }, |
83 | uglify: { | 92 | uglify: { |
84 | material: { | 93 | material: { |
@@ -103,13 +112,13 @@ module.exports = function (grunt) { | |||
103 | copy: { | 112 | copy: { |
104 | pickerjs: { | 113 | pickerjs: { |
105 | expand: true, | 114 | expand: true, |
106 | cwd: 'node_modules/pickadate/lib', | 115 | cwd: '<%= modulesDir %>/pickadate/lib', |
107 | src: 'picker.js', | 116 | src: 'picker.js', |
108 | dest: '<%= buildDir %>', | 117 | dest: '<%= buildDir %>', |
109 | }, | 118 | }, |
110 | annotator: { | 119 | annotator: { |
111 | expand: true, | 120 | expand: true, |
112 | cwd: 'node_modules/annotator/pkg', | 121 | cwd: '<%= modulesDir %>/annotator/pkg', |
113 | src: 'annotator.min.js', | 122 | src: 'annotator.min.js', |
114 | dest: '<%= buildDir %>/themes/_global/js/', | 123 | dest: '<%= buildDir %>/themes/_global/js/', |
115 | }, | 124 | }, |
@@ -120,14 +129,21 @@ module.exports = function (grunt) { | |||
120 | { | 129 | { |
121 | expand: true, | 130 | expand: true, |
122 | overwrite: true, | 131 | overwrite: true, |
123 | cwd: '<%= appDir %>/lib/icomoon-bower/', | 132 | cwd: '<%= modulesDir %>/icomoon-free-npm/Font', |
124 | src: 'fonts', | 133 | src: 'IcoMoon-Free.ttf', |
125 | dest: '<%= buildDir %>/themes/baggy/', | 134 | dest: '<%= buildDir %>/themes/baggy/fonts/', |
126 | }, | 135 | }, |
127 | { | 136 | { |
128 | expand: true, | 137 | expand: true, |
129 | overwrite: true, | 138 | overwrite: true, |
130 | cwd: '<%= appDir %>/lib/bower-pt-sans/fonts', | 139 | cwd: '<%= modulesDir %>/ptsans-npm-webfont/fonts', |
140 | src: '*', | ||
141 | dest: '<%= buildDir %>/themes/baggy/fonts/', | ||
142 | }, | ||
143 | { | ||
144 | expand: true, | ||
145 | overwrite: true, | ||
146 | cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/', | ||
131 | src: '*', | 147 | src: '*', |
132 | dest: '<%= buildDir %>/themes/baggy/fonts/', | 148 | dest: '<%= buildDir %>/themes/baggy/fonts/', |
133 | }, | 149 | }, |
@@ -138,28 +154,28 @@ module.exports = function (grunt) { | |||
138 | { | 154 | { |
139 | expand: true, | 155 | expand: true, |
140 | overwrite: true, | 156 | overwrite: true, |
141 | cwd: '<%= appDir %>/lib/icomoon-bower/', | 157 | cwd: '<%= modulesDir %>/icomoon-free-npm/Font', |
142 | src: 'fonts', | 158 | src: 'IcoMoon-Free.ttf', |
143 | dest: '<%= buildDir %>/themes/material/', | 159 | dest: '<%= buildDir %>/themes/material/fonts', |
144 | }, | 160 | }, |
145 | { | 161 | { |
146 | expand: true, | 162 | expand: true, |
147 | overwrite: true, | 163 | overwrite: true, |
148 | cwd: 'node_modules/materialize-css/', | 164 | cwd: '<%= modulesDir %>/materialize-css/', |
149 | src: 'font', | 165 | src: 'font', |
150 | dest: '<%= buildDir %>/themes/material', | 166 | dest: '<%= buildDir %>/themes/material', |
151 | }, | 167 | }, |
152 | { | 168 | { |
153 | expand: true, | 169 | expand: true, |
154 | overwrite: true, | 170 | overwrite: true, |
155 | cwd: '<%= appDir %>/lib/roboto-fontface/fonts/', | 171 | cwd: '<%= modulesDir %>/roboto-fontface/fonts/Roboto', |
156 | src: '*', | 172 | src: '*', |
157 | dest: '<%= buildDir %>/themes/material/fonts/roboto/', | 173 | dest: '<%= buildDir %>/themes/material/fonts/', |
158 | }, | 174 | }, |
159 | { | 175 | { |
160 | expand: true, | 176 | expand: true, |
161 | overwrite: true, | 177 | overwrite: true, |
162 | cwd: '<%= appDir %>/lib/material-design-icons-iconfont/dist/fonts/', | 178 | cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/', |
163 | src: '*', | 179 | src: '*', |
164 | dest: '<%= buildDir %>/themes/material/fonts/', | 180 | dest: '<%= buildDir %>/themes/material/fonts/', |
165 | }, | 181 | }, |
@@ -199,7 +215,7 @@ module.exports = function (grunt) { | |||
199 | grunt.registerTask( | 215 | grunt.registerTask( |
200 | 'js', | 216 | 'js', |
201 | 'Build and install js files', | 217 | 'Build and install js files', |
202 | ['clean:js', 'copy:pickerjs', 'concat:jsMaterial', 'concat:jsBaggy', 'browserify', 'uglify'] | 218 | ['clean:js', 'copy:pickerjs', 'browserify', 'uglify'] |
203 | ); | 219 | ); |
204 | 220 | ||
205 | grunt.registerTask( | 221 | grunt.registerTask( |