Parametrize paths.
This commit is contained in:
parent
ddd0249d4a
commit
dbb67d1285
19
Gruntfile.js
19
Gruntfile.js
@ -4,24 +4,19 @@ module.exports = function(grunt) {
|
|||||||
require('load-grunt-tasks')(grunt);
|
require('load-grunt-tasks')(grunt);
|
||||||
require('time-grunt')(grunt);
|
require('time-grunt')(grunt);
|
||||||
|
|
||||||
var appConfig = {
|
|
||||||
app: require('./bower.json'),
|
|
||||||
dist: 'dist'
|
|
||||||
};
|
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
var options = {
|
var options = {
|
||||||
accountant: appConfig,
|
accountant: {
|
||||||
|
frontend: {
|
||||||
|
app: require('./bower.json'),
|
||||||
|
src: 'accountant/frontend/static',
|
||||||
|
dist: 'dist'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
config: {
|
config: {
|
||||||
src: 'grunt-config/*.js'
|
src: 'grunt-config/*.js'
|
||||||
},
|
},
|
||||||
paths: {
|
|
||||||
frontend_js: [
|
|
||||||
'accountant/frontend/static/js/*.js'
|
|
||||||
],
|
|
||||||
frontend_build: 'accountant/frontend/static/build'
|
|
||||||
},
|
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %>\n'+
|
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %>\n'+
|
||||||
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %> */\n',
|
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %> */\n',
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
libs: [
|
libs: [
|
||||||
'accountant/frontend/static/build'
|
'<%= accountant.frontend.dist %>'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -9,8 +9,8 @@ module.exports = {
|
|||||||
'indent-width': 2
|
'indent-width': 2
|
||||||
},
|
},
|
||||||
src: [
|
src: [
|
||||||
'accountant/frontend/static/*.html',
|
'<%= accountant.frontend.src %>/*.html',
|
||||||
'accountant/frontend/static/views/*.html'
|
'<%= accountant.frontend.src %>/views/*.html'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
options: {
|
options: {
|
||||||
basePath: 'accountant/frontend/static',
|
basePath: '<%= accountant.frontend.src %>',
|
||||||
baseUrl: ''
|
baseUrl: ''
|
||||||
},
|
},
|
||||||
index: {
|
index: {
|
||||||
files: {
|
files: {
|
||||||
'accountant/frontend/static/index.html': 'accountant/frontend/static/index.html'
|
'<%= accountant.frontend.src %>/index.html': '<%= accountant.frontend.src %>/index.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ module.exports = {
|
|||||||
verbose: true
|
verbose: true
|
||||||
},
|
},
|
||||||
frontend_js: [
|
frontend_js: [
|
||||||
'<%= paths.frontend_js %>'
|
'<%= accountant.frontend.src %>/js/*.js'
|
||||||
],
|
],
|
||||||
toolchain: [
|
toolchain: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
|
@ -4,7 +4,7 @@ module.exports = {
|
|||||||
reporter: require('jshint-stylish')
|
reporter: require('jshint-stylish')
|
||||||
},
|
},
|
||||||
frontend_js: [
|
frontend_js: [
|
||||||
'<%= paths.frontend_js %>'
|
'<%= accountant.frontend.src %>/js/*.js'
|
||||||
],
|
],
|
||||||
toolchain: [
|
toolchain: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
|
@ -7,7 +7,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
js: {
|
js: {
|
||||||
files: [
|
files: [
|
||||||
'<%= paths.frontend_js %>',
|
'<%= accountant.frontend.src %>/js/*.js %>',
|
||||||
'grunt-config/*.js'
|
'grunt-config/*.js'
|
||||||
],
|
],
|
||||||
tasks: ['jsdev']
|
tasks: ['jsdev']
|
||||||
@ -18,8 +18,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
html: {
|
html: {
|
||||||
files: [
|
files: [
|
||||||
'accountant/frontend/static/*.html',
|
'<%= accountant.frontend.src %>/*.html',
|
||||||
'accountant/frontend/static/views/*.html'
|
'<%= accountant.frontend.src %>/views/*.html'
|
||||||
],
|
],
|
||||||
tasks: ['htmldev']
|
tasks: ['htmldev']
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
app: {
|
app: {
|
||||||
src: ['accountant/frontend/static/index.html'],
|
src: ['<%= accountant.frontend.src %>/index.html'],
|
||||||
ignorePath: /\.\.\//
|
ignorePath: /\.\.\//
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user