Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
grunt-monty-python
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
98e725cf
authored
2015-12-15 16:12:20 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Allow for the 'src' directory to be changed to a different location.
1 parent
26c3aea6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
grunt-monty-python.js
grunt-monty-python.js
View file @
98e725c
...
...
@@ -135,6 +135,9 @@ module.exports = function (grunt) {
});
function
createConfig
(
mpConfig
)
{
mpConfig
=
_
.
extend
({
base
:
'src'
,
},
mpConfig
);
var
featureFlags
=
{};
var
holyGrailTmp
=
'.grunt/holygrail'
;
...
...
@@ -157,7 +160,7 @@ module.exports = function (grunt) {
files
:
[{
expand
:
true
,
dot
:
true
,
cwd
:
'src'
,
cwd
:
mpConfig
.
base
,
dest
:
'dist/build'
,
src
:
[
'WEB-INF/{,*/}*.*'
,
...
...
@@ -226,7 +229,7 @@ module.exports = function (grunt) {
}),
files
:
{
src
:
[
'src
/scripts/*.js'
,
mpConfig
.
base
+
'
/scripts/*.js'
,
],
},
},
...
...
@@ -239,7 +242,7 @@ module.exports = function (grunt) {
}),
files
:
{
src
:
[
'src
/scripts/model/**/*.js'
,
mpConfig
.
base
+
'
/scripts/model/**/*.js'
,
],
},
},
...
...
@@ -252,15 +255,15 @@ module.exports = function (grunt) {
}),
files
:
{
src
:
[
'src
/scripts/view/**/*.js'
,
mpConfig
.
base
+
'
/scripts/view/**/*.js'
,
],
},
},
};
jshintAddExtra
(
mpConfig
.
jshint
.
all
,
initConfig
.
jshint
,
'all'
);
jshintAddExtra
(
mpConfig
.
jshint
.
main
,
initConfig
.
jshint
.
main
.
files
,
'src'
);
jshintAddExtra
(
mpConfig
.
jshint
.
model
,
initConfig
.
jshint
.
model
.
files
,
'src'
);
jshintAddExtra
(
mpConfig
.
jshint
.
view
,
initConfig
.
jshint
.
view
.
files
,
'src'
);
jshintAddExtra
(
mpConfig
.
jshint
.
main
,
initConfig
.
jshint
.
main
.
files
,
mpConfig
.
base
);
jshintAddExtra
(
mpConfig
.
jshint
.
model
,
initConfig
.
jshint
.
model
.
files
,
mpConfig
.
base
);
jshintAddExtra
(
mpConfig
.
jshint
.
view
,
initConfig
.
jshint
.
view
.
files
,
mpConfig
.
base
);
checkList
.
push
(
'jshint'
);
}
...
...
@@ -305,8 +308,8 @@ module.exports = function (grunt) {
initConfig
.
punch
=
{
options
:
{
'template_dir'
:
'src
/punch/templates'
,
'content_dir'
:
'src
/punch/contents'
,
'template_dir'
:
mpConfig
.
base
+
'
/punch/templates'
,
'content_dir'
:
mpConfig
.
base
+
'
/punch/contents'
,
plugins
:
{
parsers
:
{
'.html'
:
'punch-html-fragment-content-parser'
,
...
...
@@ -329,7 +332,7 @@ module.exports = function (grunt) {
]
});
}
else
{
htmlSourceDir
=
'src'
;
htmlSourceDir
=
mpConfig
.
base
;
}
if
(
mpConfig
.
uglify
)
{
...
...
@@ -381,7 +384,7 @@ module.exports = function (grunt) {
files
:
[{
expand
:
true
,
dot
:
true
,
cwd
:
'src'
,
cwd
:
mpConfig
.
base
,
dest
:
'.grunt/usemin-css/'
,
src
:
_
.
map
(
mpConfig
.
css
.
options
.
dirs
,
function
(
value
)
{
return
value
+
'/{,**/}*.css'
;
...
...
@@ -409,7 +412,7 @@ module.exports = function (grunt) {
files
:
_
.
map
(
mpConfig
.
images
.
options
.
dirs
,
function
(
value
)
{
return
{
expand
:
true
,
cwd
:
'src
/'
+
value
,
cwd
:
mpConfig
.
base
+
'
/'
+
value
,
src
:
'{,**/}*.{gif,jpeg,jpg,png}'
,
dest
:
'dist/build/'
+
value
,
};
...
...
@@ -421,7 +424,7 @@ module.exports = function (grunt) {
files
:
_
.
map
(
mpConfig
.
images
.
options
.
dirs
,
function
(
value
)
{
return
{
expand
:
true
,
cwd
:
'src
/'
+
value
,
cwd
:
mpConfig
.
base
+
'
/'
+
value
,
src
:
'{,**/}*.svg'
,
dest
:
'dist/build/'
+
value
,
};
...
...
@@ -432,7 +435,7 @@ module.exports = function (grunt) {
files
:
[{
expand
:
true
,
dot
:
true
,
cwd
:
'src'
,
cwd
:
mpConfig
.
base
,
dest
:
'dist/build'
,
src
:
_
.
map
(
mpConfig
.
images
.
options
.
dirs
,
function
(
value
)
{
return
value
+
'/{,**/}*.*'
;
...
...
@@ -456,7 +459,7 @@ module.exports = function (grunt) {
});
initConfig
.
bower
=
{
options
:
{
directory
:
'src
/'
+
mpConfig
.
bower
.
directory
,
directory
:
mpConfig
.
base
+
'
/'
+
mpConfig
.
bower
.
directory
,
},
install
:
{},
update
:
{},
...
...
@@ -496,9 +499,9 @@ module.exports = function (grunt) {
files
:
[{
dest
:
'dist/build/'
+
mpConfig
.
bower
.
directory
+
'/requirejs/require.js'
,
src
:
[
'src
/scripts/config.js'
,
mpConfig
.
base
+
'
/scripts/config.js'
,
'.grunt/holygrail/scripts/requirejs-config.js'
,
'src
/'
+
mpConfig
.
bower
.
directory
+
'/requirejs/require.js'
,
mpConfig
.
base
+
'
/'
+
mpConfig
.
bower
.
directory
+
'/requirejs/require.js'
,
],
}],
};
...
...
@@ -513,9 +516,9 @@ module.exports = function (grunt) {
grunt
.
config
(
'requireModules.'
+
target
+
'.'
+
grunt
.
config
.
escape
(
data
.
name
),
data
.
included
);
},
baseUrl
:
'src
/scripts'
,
baseUrl
:
mpConfig
.
base
+
'
/scripts'
,
mainConfigFile
:
[
'src
/scripts/config.js'
,
mpConfig
.
base
+
'
/scripts/config.js'
,
],
wrapShim
:
true
,
...
...
Please
register
or
sign in
to post a comment