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
67944948
authored
2016-12-16 20:54:43 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Generate the fixed require config even if useRev is turned off.
1 parent
d800ecf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
grunt-monty-python.js
grunt-monty-python.js
View file @
6794494
...
...
@@ -54,23 +54,22 @@ module.exports = function (grunt) {
token
=
tokens
[
i
];
ptr
=
ptr
[
token
]
||
(
ptr
[
token
]
=
{});
}
ptr
[
last
]
=
paths
[
prop
].
replace
(
/^
(?:
.*
\/)?(
[
a-f0-9
]
+
)\.
.*$/
,
'$1'
);
ptr
[
last
]
=
paths
[
prop
].
replace
(
/^
(?:
.*
\/)?(
?:([
a-f0-9
]
+
)\.)?
.*$/
,
'$1'
);
}
return
result
;
}
var
config
=
grunt
.
config
(
'montyPython.config'
);
var
featureFlags
=
grunt
.
config
(
'montyPython.featureFlags'
);
var
segment
=
{},
segments
=
{};
// ---
if
(
config
.
useRev
)
{
if
(
true
)
{
var
prefix
=
grunt
.
template
.
process
(
'dist/build/scripts/'
);
var
pattern
=
prefix
+
'**/*.{js,html}'
;
var
files
=
grunt
.
file
.
expand
(
pattern
);
if
(
files
.
length
)
{
_
.
each
(
files
,
function
(
file
)
{
file
=
file
.
substring
(
prefix
.
length
);
var
res
=
file
.
match
(
/^
(
.*
\/)?(
[
0-9a-f
]
+
)\.
([^\/]
+
)\.([^\.]
+
)
$/
);
var
res
=
file
.
match
(
/^
(
.*
\/)?(
?:([
0-9a-f
]
+
)\.)?
([^\/]
+
)\.([^\.]
+
)
$/
);
if
(
!
res
)
{
return
;
}
...
...
@@ -132,7 +131,7 @@ module.exports = function (grunt) {
' for (prop in paths) {'
,
' value = paths[prop];'
,
' if (typeof value === "string") {'
,
' result[prefix + prop] = prefix +
value + "."
+ prop;'
,
' result[prefix + prop] = prefix +
(value ? (value + ".") : "")
+ prop;'
,
' } else {'
,
' expandPaths(value, prefix + prop + "/", result);'
,
' }'
,
...
...
Please
register
or
sign in
to post a comment