Skip to content

Commit

Permalink
improved grunt config for yawik
Browse files Browse the repository at this point in the history
  • Loading branch information
kilip committed Oct 29, 2018
1 parent 7617254 commit bdb53d7
Show file tree
Hide file tree
Showing 19 changed files with 107 additions and 1,413 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

global.nodeModulesPath = __dirname+"/node_modules";
global.nodeModulesPath = __dirname + "/node_modules";

module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
Expand Down
104 changes: 80 additions & 24 deletions module/Core/public/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = function(grunt) {
grunt.initConfig({
copy: {
main: {
core: {
files: [
{
expand: true,
Expand All @@ -21,51 +21,107 @@ module.exports = function(grunt) {
less: {
options: {
modifyVars: {
"fa-font-path": "fonts",
"flag-icon-css-path": "flags"
"fa-font-path": "../fonts",
"flag-icon-css-path": "../flags"
}
},
dev: {
core: {
options: {
compress: false,
},
files: {
"public/dist/core.css": "public/modules/Core/less/yawik.less" // destination file and source file
}
},
prod: {
options: {
compress: true,
optimization: 2
"public/dist/css/core.css": [
"public/modules/Core/less/yawik.less",
"./node_modules/select2/dist/css/select2.min.css",
"./node_modules/pnotify/dist/pnotify.css",
"./node_modules/pnotify/dist/pnotify.buttons.css",
"./node_modules/tinymce/skins/lightgray/skin.min.css",
"./node_modules/bootsrap3-dialog/dist/css/bootstrap-dialog.css"
]
},
files: {
"public/dist/core.min.css": "public/modules/Core/less/yawik.less" // destination file and source file
}
}
},
},
concat: {
options: {
//compress: false,
//beautify: true,
},
dist: {
core: {
src: [
"./node_modules/jquery/dist/jquery.js",
"./node_modules/jquery-migrate/dist/jquery-migrate.js",
"./node_modules/bootstrap/dist/js/bootstrap.js",
"./node_modules/pnotify/dist/pnotify.js",
"./node_modules/pnotify/dist/pnotify.buttons.js",
"./node_modules/select2/dist/js/select2.js",
"./node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js",
"./node_modules/blueimp-file-upload/js/jquery.iframe-transport.js",
"./node_modules/blueimp-file-upload/js/jquery.fileupload.js",
"./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js",
"./node_modules/twitter-bootstrap-wizard/jquery.bootstrap.wizard.js",
"./public/modules/Core/js/core.init.js"
"./node_modules/tinymce/tinymce.js",

// tiny mce tasks
"./node_modules/tinymce/themes/modern/theme.js",
"./node_modules/tinymce/plugins/autolink/plugin.js",
"./node_modules/tinymce/plugins/lists/plugin.js",
"./node_modules/tinymce/plugins/advlist/plugin.js",
"./node_modules/tinymce/plugins/visualblocks/plugin.js",
"./node_modules/tinymce/plugins/code/plugin.js",
"./node_modules/tinymce/plugins/fullscreen/plugin.js",
"./node_modules/tinymce/plugins/contextmenu/plugin.js",
"./node_modules/tinymce/plugins/paste/plugin.js",
"./node_modules/tinymce/plugins/link/plugin.js",

"./public/modules/Core/js/core.init.js",
],
dest: "public/dist/core.min.js"
dest: "public/dist/js/core.js"
},
locales: {
files: {
"./public/dist/locales/en.js": [
"./node_modules/select2/dist/js/i18n/en.js"
],
"./public/dist/locales/de.js": [
"./node_modules/select2/dist/js/i18n/de.js",
"./node_modules/bootstrap-datepicker/dist/locales/bootstrap-datepicker.de.js"
],
"./public/dist/locales/es.js": [
"./node_modules/select2/dist/js/i18n/es.js",
"./node_modules/bootstrap-datepicker/dist/locales/bootstrap-datepicker.es.js"
],
"./public/dist/locales/fr.js": [
"./node_modules/select2/dist/js/i18n/fr.js",
"./node_modules/bootstrap-datepicker/dist/locales/bootstrap-datepicker.fr.js"
],
"./public/dist/locales/it.js": [
"./node_modules/select2/dist/js/i18n/it.js",
"./node_modules/bootstrap-datepicker/dist/locales/bootstrap-datepicker.it.js"
],
}
},
bootstrapDialog: {
src: [
'./node_modules/bootstrap3-dialog/dist/js/bootstrap-dialog.js'
],
dest: "public/dist/js/bootstrap-dialog.js"
}
},
uglify: {
options: {
"compress": true,
},
core: {
files: {
'./public/dist/js/core.min.js': './public/dist/js/core.js',
'./public/dist/js/bootstrap-dialog.min.js': './public/dist/js/bootstrap-dialog.js',
}
},
},
cssmin: {
core: {
files: {
'./public/dist/css/core.min.css': './public/dist/css/core.css'
}
}
}
});

grunt.registerTask('yawik:core',["copy","less:prod","concat"]);
grunt.registerTask('yawik:core:dev',["copy","less","concat"]);
grunt.registerTask('yawik:core',["copy:core","less:core","concat:core", 'cssmin:core',"uglify:core"]);
};
5 changes: 3 additions & 2 deletions module/Core/public/locales/de.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions module/Core/public/locales/en.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions module/Core/public/locales/es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions module/Core/public/locales/fr.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions module/Core/public/locales/it.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bdb53d7

Please sign in to comment.