Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Toolchain
sgc
Commits
4a1c2200
Commit
4a1c2200
authored
Jan 08, 2015
by
Philipp Nowinski
Browse files
[FEATURE] add javascript task
parent
33cf23ec
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/index.js
View file @
4a1c2200
...
...
@@ -119,6 +119,16 @@ module.exports = yeoman.generators.Base.extend((function() {
this
.
destinationPath
(
'
gulp/browser-sync.js
'
),
answers
);
this
.
fs
.
copyTpl
(
this
.
templatePath
(
'
gulp/images.js
'
),
this
.
destinationPath
(
'
gulp/images.js
'
),
answers
);
this
.
fs
.
copyTpl
(
this
.
templatePath
(
'
gulp/javascript.js
'
),
this
.
destinationPath
(
'
gulp/javascript.js
'
),
answers
);
};
Generator
.
writeCompassConfig
=
function
()
{
...
...
@@ -144,6 +154,13 @@ module.exports = yeoman.generators.Base.extend((function() {
);
};
Generator
.
writeJavascript
=
function
()
{
this
.
fs
.
copy
(
this
.
templatePath
(
'
_main.js
'
),
this
.
destinationPath
(
answers
.
javascriptPath
+
'
/main.js
'
)
);
};
Generator
.
writeDirectories
=
function
()
{
this
.
mkdir
(
this
.
destinationPath
(
'
images
'
));
this
.
mkdir
(
this
.
destinationPath
(
'
fonts
'
));
...
...
app/templates/_gulpfile.js
View file @
4a1c2200
...
...
@@ -2,8 +2,6 @@
var
gulp
=
require
(
'
gulp
'
),
path
=
require
(
'
path
'
),
imagemin
=
require
(
'
gulp-imagemin
'
),
jshint
=
require
(
'
gulp-jshint
'
),
argv
=
require
(
'
yargs
'
).
argv
<%
if
(
projectType
==
'
typo3Frontend
'
)
{
%>
extension
=
(
function
()
{
if
(
typeof
argv
.
ext
===
'
undefined
'
)
{
...
...
@@ -13,17 +11,3 @@ var gulp = require('gulp'),
}())
<%
}
%>
;
require
(
'
require-dir
'
)(
'
./gulp
'
);
gulp
.
task
(
'
jshint
'
,
function
()
{
return
gulp
.
src
(
jsPath
+
'
/**/*.js
'
)
.
pipe
(
jshint
.
reporter
(
'
jshint-stylish
'
));
});
gulp
.
task
(
'
images
'
,
function
()
{
return
gulp
.
src
(
imagePath
+
'
/**/*
'
)
.
pipe
(
imagemin
({
progressive
:
true
,
svgoPlugins
:
[{
removeViewBox
:
false
}]
}))
.
pipe
(
gulp
.
dest
(
imagePath
));
});
app/templates/_main.js
0 → 100644
View file @
4a1c2200
'
use strict
'
;
console
.
log
(
'
Sgalinski says
\'
allo,
\'
allo
'
);
app/templates/_package.json
View file @
4a1c2200
...
...
@@ -13,6 +13,9 @@
"gulp-minify-css"
:
"^0.3.11"
,
"gulp-imagemin"
:
"^2.1.0"
,
"gulp-jshint"
:
"^1.9.0"
,
"jshint-stylish"
:
"^1.0.0"
,
"gulp-concat"
:
"^2.4.3"
,
"gulp-uglify"
:
"^1.0.2"
,
"require-dir"
:
"^0.1.0"
,
"yargs"
:
"^1.3.3"
}
...
...
app/templates/gulp/images.js
0 → 100644
View file @
4a1c2200
'
use strict
'
;
var
gulp
=
require
(
'
gulp
'
),
settings
=
require
(
'
./settings
'
),
imagemin
=
require
(
'
gulp-imagemin
'
);
gulp
.
task
(
'
images
'
,
function
()
{
return
gulp
.
src
(
settings
.
path
.
imagePath
+
'
/**/*
'
)
.
pipe
(
imagemin
({
progressive
:
true
,
svgoPlugins
:
[{
removeViewBox
:
false
}]
}))
.
pipe
(
gulp
.
dest
(
settings
.
path
.
images
));
});
app/templates/gulp/javascript.js
0 → 100644
View file @
4a1c2200
'
use strict
'
;
var
gulp
=
require
(
'
gulp
'
),
settings
=
require
(
'
./settings
'
),
jshint
=
require
(
'
gulp-jshint
'
),
concat
=
require
(
'
gulp-concat
'
),
uglify
=
require
(
'
gulp-uglify
'
);
gulp
.
task
(
'
jshint
'
,
function
()
{
return
gulp
.
src
(
settings
.
path
.
javascript
+
'
/**/*.js
'
)
.
pipe
(
jshint
())
.
pipe
(
jshint
.
reporter
(
'
jshint-stylish
'
));
});
gulp
.
task
(
'
javascript
'
,
function
()
{
return
gulp
.
src
(
settings
.
path
.
javascript
+
'
/**/*.js
'
)
.
pipe
(
jshint
())
.
pipe
(
jshint
.
reporter
(
'
jshint-stylish
'
))
.
pipe
(
concat
(
'
main.js
'
))
.
pipe
(
uglify
())
.
pipe
(
gulp
.
dest
(
'
./
'
));
});
app/templates/gulp/settings.js
View file @
4a1c2200
...
...
@@ -3,6 +3,7 @@ module.exports = {
css
:
'
<%= cssPath %>
'
,
sass
:
'
<%= sassPath %>
'
,
javascript
:
'
<%= javascriptPath %>
'
,
compassConfig
:
'
<%= compassConfigPath %>
'
compassConfig
:
'
<%= compassConfigPath %>
'
,
images
:
'
<%= imagesPath %>
'
}
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment