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
e958f8b5
authored
2015-09-04 18:18:53 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Integrating uglify.
1 parent
a421f05b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
grunt-monty-python.js
package.json
grunt-monty-python.js
View file @
e958f8b
...
...
@@ -204,6 +204,12 @@ module.exports = function (grunt) {
htmlSourceDir
=
'src'
;
}
if
(
mpConfig
.
uglify
)
{
initConfig
.
uglify
=
{
options
:
mpConfig
.
uglify
,
};
}
if
(
true
)
{
initConfig
.
useminPrepare
=
{
options
:
{
...
...
@@ -327,6 +333,19 @@ module.exports = function (grunt) {
install
:
{},
update
:
{},
};
if
(
mpConfig
.
uglify
)
{
initConfig
.
uglify
.
montyPython
=
{
files
:
[{
expand
:
true
,
dot
:
true
,
cwd
:
'dist/'
+
mpConfig
.
bower
.
directory
,
dest
:
'dist/'
+
mpConfig
.
bower
.
directory
,
src
:
[
'**/*.js'
,
]
}]
};
}
if
(
mpConfig
.
useRev
)
{
initConfig
.
rev
.
dist
.
files
.
push
({
src
:
[
...
...
@@ -417,7 +436,6 @@ module.exports = function (grunt) {
};
}
grunt
.
initConfig
(
initConfig
);
grunt
.
registerTask
(
'check'
,
checkList
);
...
...
@@ -442,7 +460,7 @@ module.exports = function (grunt) {
'container = (container[propName] = container[propName] || {});'
,
];
for
(
var
flag
in
featureFlags
)
{
lines
.
push
(
'
require.config.featureFlags
['
+
JSON
.
stringify
(
flag
)
+
']='
+
JSON
.
stringify
(
featureFlags
[
flag
])
+
';'
);
lines
.
push
(
'
container
['
+
JSON
.
stringify
(
flag
)
+
']='
+
JSON
.
stringify
(
featureFlags
[
flag
])
+
';'
);
}
//lines.push('return bundles;');
lines
.
push
(
'})(require.config, \'featureFlags\');'
);
...
...
@@ -451,7 +469,7 @@ module.exports = function (grunt) {
}
grunt
.
file
.
write
(
'.grunt/holygrail/scripts/featureFlags.js'
,
lines
.
join
(
'\n'
));
});
buildList
.
add
(
'writeFeatureFlags'
);
buildList
.
push
(
'writeFeatureFlags'
);
}
if
(
mpConfig
.
punch
)
{
...
...
@@ -476,7 +494,9 @@ module.exports = function (grunt) {
//'uglify:dist');
buildList
.
push
(
'copy:dist'
);
//'modernizr');
//buildList.push('uglify:generated'); // montyPython
if
(
mpConfig
.
uglify
)
{
buildList
.
push
(
'uglify:generated'
);
// montyPython
}
if
(
mpConfig
.
useRev
)
{
buildList
.
push
(
'rev:dist'
);
// montyPython
buildList
.
push
(
'rev:css'
);
// montyPython
...
...
@@ -488,8 +508,9 @@ module.exports = function (grunt) {
if
(
mpConfig
.
useRev
)
{
buildList
.
push
(
'rev:requirejs'
);
}
//buildList.push('uglify:bower'); // montyPython
//buildList.push('uglify:requireconfig'); // montyPython
if
(
mpConfig
.
bower
&&
mpConfig
.
uglify
)
{
buildList
.
push
(
'uglify:montyPython'
);
// montyPython
}
buildList
.
push
(
'usemin:html'
);
// montyPython
buildList
.
push
(
'usemin:css'
);
// montyPython
buildList
.
push
(
'htmlmin'
);
// montyPython
...
...
package.json
View file @
e958f8b
...
...
@@ -25,6 +25,7 @@
"grunt-contrib-htmlmin"
:
"~0"
,
"grunt-contrib-imagemin"
:
"~0"
,
"grunt-contrib-requirejs"
:
"~0"
,
"grunt-contrib-uglify"
:
"~0"
,
"grunt-rev"
:
"~0"
,
"grunt-svgmin"
:
"~0"
,
"grunt-usemin"
:
"~2"
,
...
...
Please
register
or
sign in
to post a comment