1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Added back gruntfile

This commit is contained in:
Hillel Coren 2015-04-12 12:58:28 +03:00
parent 0e2eba4521
commit c19d09fa0c
5 changed files with 134 additions and 2 deletions

View File

@ -1,5 +1,6 @@
APP_ENV=development
APP_DEBUG=true
APP_URL=http://ninja.dev
APP_KEY=
DB_TYPE=mysql

124
Gruntfile.js Normal file
View File

@ -0,0 +1,124 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
process: function(src, filepath) {
var basepath = filepath.substring(7, filepath.lastIndexOf('/') + 1);
// Fix relative paths for css files
if(filepath.indexOf('.css', filepath.length - 4) !== -1) {
return src.replace(/(url\s*[\("']+)\s*([^'"\)]+)(['"\)]+;?)/gi, function(match, start, url, end, offset, string) {
if(url.indexOf('data:') === 0) {
// Skip data urls
return match;
} else if(url.indexOf('/') === 0) {
// Skip absolute urls
return match;
} else {
return start + basepath + url + end;
}
});
// Fix source maps locations
} else if(filepath.indexOf('.js', filepath.length - 4) !== -1) {
return src.replace(/(\/[*\/][#@]\s*sourceMappingURL=)([^\s]+)/gi, function(match, start, url, offset, string) {
if(url.indexOf('/') === 0) {
// Skip absolute urls
return match;
} else {
return start + basepath + url;
}
});
// Don't do anything for unknown file types
} else {
return src;
}
},
},
js: {
src: [
'public/vendor/jquery/dist/jquery.js',
'public/vendor/jquery-ui/jquery-ui.min.js',
'public/vendor/bootstrap/dist/js/bootstrap.min.js',
'public/vendor/datatables/media/js/jquery.dataTables.js',
'public/vendor/datatables-bootstrap3/BS3/assets/js/datatables.js',
'public/vendor/knockout.js/knockout.js',
'public/vendor/knockout-mapping/build/output/knockout.mapping-latest.js',
'public/vendor/knockout-sortable/build/knockout-sortable.min.js',
'public/vendor/underscore/underscore.js',
'public/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js',
'public/vendor/typeahead.js/dist/typeahead.min.js',
'public/vendor/accounting/accounting.min.js',
'public/vendor/spectrum/spectrum.js',
'public/vendor/jspdf/dist/jspdf.min.js',
//'public/vendor/handsontable/dist/jquery.handsontable.full.min.js',
'public/js/lightbox.min.js',
'public/js/bootstrap-combobox.js',
'public/js/script.js',
],
dest: 'public/js/built.js',
nonull: true
},
js_public: {
src: [
/*
'public/js/simpleexpand.js',
'public/js/valign.js',
'public/js/bootstrap.min.js',
'public/js/simpleexpand.js',
*/
'public/vendor/bootstrap/dist/js/bootstrap.min.js',
],
dest: 'public/js/built.public.js',
nonull: true
},
css: {
src: [
'public/vendor/bootstrap/dist/css/bootstrap.min.css',
'public/vendor/datatables/media/css/jquery.dataTables.css',
'public/vendor/datatables-bootstrap3/BS3/assets/css/datatables.css',
'public/vendor/font-awesome/css/font-awesome.min.css',
'public/vendor/bootstrap-datepicker/css/datepicker.css',
'public/vendor/spectrum/spectrum.css',
'public/css/bootstrap-combobox.css',
'public/css/typeahead.js-bootstrap.css',
'public/css/lightbox.css',
//'public/vendor/handsontable/dist/jquery.handsontable.full.css',
'public/css/style.css',
],
dest: 'public/css/built.css',
nonull: true,
options: {
process: false
}
},
css_public: {
src: [
'public/vendor/bootstrap/dist/css/bootstrap.min.css',
/*
'public/css/bootstrap.splash.css',
'public/css/splash.css',
*/
'public/vendor/datatables/media/css/jquery.dataTables.css',
'public/vendor/datatables-bootstrap3/BS3/assets/css/datatables.css',
],
dest: 'public/css/built.public.css',
nonull: true,
options: {
process: false
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('default', ['concat']);
};

View File

@ -71,6 +71,7 @@ class AppController extends BaseController
// == ENV Settings (Production) == //
$config = "APP_ENV=development\n".
"APP_DEBUG=true\n".
"APP_URL={$app['url']}\n".
"APP_KEY={$app['key']}\n\n".
"DB_TYPE={$dbType}\n".
"DB_HOST={$database['type']['host']}\n".

View File

@ -26,7 +26,7 @@ return [
|
*/
'url' => '',
'url' => env('APP_URL', ''),
/*
|--------------------------------------------------------------------------

View File

@ -2,6 +2,12 @@
"private": true,
"devDependencies": {
"gulp": "^3.8.8",
"laravel-elixir": "*"
"laravel-elixir": "*",
"grunt": "~0.4.0",
"grunt": "~0.4.4",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-concat": "~0.4.0"
}
}