Parametrize paths.

This commit is contained in:
Alexis Lahouze 2016-02-17 09:52:13 +01:00
parent ddd0249d4a
commit dbb67d1285
8 changed files with 18 additions and 23 deletions

View File

@ -4,24 +4,19 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
var appConfig = {
app: require('./bower.json'),
dist: 'dist'
};
// Options
var options = {
accountant: appConfig,
accountant: {
frontend: {
app: require('./bower.json'),
src: 'accountant/frontend/static',
dist: 'dist'
}
},
config: {
src: 'grunt-config/*.js'
},
paths: {
frontend_js: [
'accountant/frontend/static/js/*.js'
],
frontend_build: 'accountant/frontend/static/build'
},
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %>\n'+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %> */\n',

View File

@ -2,6 +2,6 @@
module.exports = {
libs: [
'accountant/frontend/static/build'
'<%= accountant.frontend.dist %>'
]
};

View File

@ -9,8 +9,8 @@ module.exports = {
'indent-width': 2
},
src: [
'accountant/frontend/static/*.html',
'accountant/frontend/static/views/*.html'
'<%= accountant.frontend.src %>/*.html',
'<%= accountant.frontend.src %>/views/*.html'
]
}
};

View File

@ -2,12 +2,12 @@
module.exports = {
options: {
basePath: 'accountant/frontend/static',
basePath: '<%= accountant.frontend.src %>',
baseUrl: ''
},
index: {
files: {
'accountant/frontend/static/index.html': 'accountant/frontend/static/index.html'
'<%= accountant.frontend.src %>/index.html': '<%= accountant.frontend.src %>/index.html'
}
}
};

View File

@ -4,7 +4,7 @@ module.exports = {
verbose: true
},
frontend_js: [
'<%= paths.frontend_js %>'
'<%= accountant.frontend.src %>/js/*.js'
],
toolchain: [
'Gruntfile.js',

View File

@ -4,7 +4,7 @@ module.exports = {
reporter: require('jshint-stylish')
},
frontend_js: [
'<%= paths.frontend_js %>'
'<%= accountant.frontend.src %>/js/*.js'
],
toolchain: [
'Gruntfile.js',

View File

@ -7,7 +7,7 @@ module.exports = {
},
js: {
files: [
'<%= paths.frontend_js %>',
'<%= accountant.frontend.src %>/js/*.js %>',
'grunt-config/*.js'
],
tasks: ['jsdev']
@ -18,8 +18,8 @@ module.exports = {
},
html: {
files: [
'accountant/frontend/static/*.html',
'accountant/frontend/static/views/*.html'
'<%= accountant.frontend.src %>/*.html',
'<%= accountant.frontend.src %>/views/*.html'
],
tasks: ['htmldev']
},

View File

@ -1,6 +1,6 @@
module.exports = {
app: {
src: ['accountant/frontend/static/index.html'],
src: ['<%= accountant.frontend.src %>/index.html'],
ignorePath: /\.\.\//
}
};