Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
todomvc
Commits
3892594b
Commit
3892594b
authored
Jul 03, 2015
by
Arthur Verschaeve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code style in `gulpfile.js`
parent
06554414
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
63 deletions
+63
-63
gulpfile.js
gulpfile.js
+63
-63
No files found.
gulpfile.js
View file @
3892594b
...
...
@@ -9,82 +9,82 @@ var pagespeed = require('psi');
var
app
=
require
(
'
./server
'
);
var
AUTOPREFIXER_BROWSERS
=
[
'
ie >= 10
'
,
'
ie_mob >= 10
'
,
'
ff >= 30
'
,
'
chrome >= 34
'
,
'
safari >= 7
'
,
'
opera >= 23
'
,
'
ios >= 7
'
,
'
android >= 4.4
'
,
'
bb >= 10
'
'
ie >= 10
'
,
'
ie_mob >= 10
'
,
'
ff >= 30
'
,
'
chrome >= 34
'
,
'
safari >= 7
'
,
'
opera >= 23
'
,
'
ios >= 7
'
,
'
android >= 4.4
'
,
'
bb >= 10
'
];
// Lint JavaScript
gulp
.
task
(
'
jshint
'
,
function
()
{
return
gulp
.
src
(
'
site-assets/*.js
'
)
.
pipe
(
$
.
jshint
())
.
pipe
(
$
.
jshint
.
reporter
(
'
jshint-stylish
'
));
return
gulp
.
src
(
'
site-assets/*.js
'
)
.
pipe
(
$
.
jshint
())
.
pipe
(
$
.
jshint
.
reporter
(
'
jshint-stylish
'
));
});
// Optimize Images
gulp
.
task
(
'
images
'
,
function
()
{
return
gulp
.
src
(
'
site-assets/*.{png,jpg,svg}
'
)
.
pipe
(
$
.
cache
(
$
.
imagemin
({
progressive
:
true
,
interlaced
:
true
})))
.
pipe
(
gulp
.
dest
(
'
dist/site-assets
'
))
.
pipe
(
$
.
size
({
title
:
'
images
'
}));
return
gulp
.
src
(
'
site-assets/*.{png,jpg,svg}
'
)
.
pipe
(
$
.
cache
(
$
.
imagemin
({
progressive
:
true
,
interlaced
:
true
})))
.
pipe
(
gulp
.
dest
(
'
dist/site-assets
'
))
.
pipe
(
$
.
size
({
title
:
'
images
'
}));
});
// Copy All Files At The Root Level (app)
gulp
.
task
(
'
copy
'
,
function
()
{
return
gulp
.
src
([
'
examples/**
'
,
'
bower_components/**
'
,
'
learn.json
'
,
'
CNAME
'
,
'
.nojekyll
'
,
'
site-assets/favicon.ico
'
],
{
dot
:
true
,
base
:
'
./
'
}).
pipe
(
gulp
.
dest
(
'
dist
'
))
.
pipe
(
$
.
size
({
title
:
'
copy
'
}));
return
gulp
.
src
([
'
examples/**
'
,
'
bower_components/**
'
,
'
learn.json
'
,
'
CNAME
'
,
'
.nojekyll
'
,
'
site-assets/favicon.ico
'
],
{
dot
:
true
,
base
:
'
./
'
}).
pipe
(
gulp
.
dest
(
'
dist
'
))
.
pipe
(
$
.
size
({
title
:
'
copy
'
}));
});
// Compile and Automatically Prefix Stylesheets
gulp
.
task
(
'
styles
'
,
function
()
{
// For best performance, don't add Sass partials to `gulp.src`
return
gulp
.
src
([
'
site-assets/*.css
'
,
])
.
pipe
(
$
.
autoprefixer
(
AUTOPREFIXER_BROWSERS
))
.
pipe
(
gulp
.
dest
(
'
dist/site-assets
'
))
.
pipe
(
$
.
size
({
title
:
'
styles
'
}))
.
pipe
(
gulp
.
dest
(
'
.tmp/site-assets
'
));
// For best performance, don't add Sass partials to `gulp.src`
return
gulp
.
src
([
'
site-assets/*.css
'
])
.
pipe
(
$
.
autoprefixer
(
AUTOPREFIXER_BROWSERS
))
.
pipe
(
gulp
.
dest
(
'
dist/site-assets
'
))
.
pipe
(
$
.
size
({
title
:
'
styles
'
}))
.
pipe
(
gulp
.
dest
(
'
.tmp/site-assets
'
));
});
// Scan Your HTML For Assets & Optimize Them
gulp
.
task
(
'
html
'
,
function
()
{
var
assets
=
$
.
useref
.
assets
({
searchPath
:
'
{.tmp,.}
'
});
var
assets
=
$
.
useref
.
assets
({
searchPath
:
'
{.tmp,.}
'
});
return
gulp
.
src
(
'
index.html
'
)
.
pipe
(
assets
)
// Concatenate And Minify JavaScript
.
pipe
(
$
.
if
(
'
*.js
'
,
$
.
uglify
({
preserveComments
:
'
some
'
})))
// Concatenate And Minify Styles
.
pipe
(
$
.
if
(
'
*.css
'
,
$
.
csso
()))
.
pipe
(
assets
.
restore
())
.
pipe
(
$
.
useref
())
// Output Files
.
pipe
(
gulp
.
dest
(
'
dist
'
))
// Running vulcanize over the written output
// because it requires access to the written
// CSS and JS.
.
pipe
(
$
.
vulcanize
({
dest
:
'
dist
'
,
strip
:
true
}))
.
pipe
(
$
.
size
({
title
:
'
html
'
}));
return
gulp
.
src
(
'
index.html
'
)
.
pipe
(
assets
)
// Concatenate And Minify JavaScript
.
pipe
(
$
.
if
(
'
*.js
'
,
$
.
uglify
({
preserveComments
:
'
some
'
})))
// Concatenate And Minify Styles
.
pipe
(
$
.
if
(
'
*.css
'
,
$
.
csso
()))
.
pipe
(
assets
.
restore
())
.
pipe
(
$
.
useref
())
// Output Files
.
pipe
(
gulp
.
dest
(
'
dist
'
))
// Running vulcanize over the written output
// because it requires access to the written
// CSS and JS.
.
pipe
(
$
.
vulcanize
({
dest
:
'
dist
'
,
strip
:
true
}))
.
pipe
(
$
.
size
({
title
:
'
html
'
}));
});
// Clean Output Directory
...
...
@@ -92,20 +92,20 @@ gulp.task('clean', del.bind(null, ['.tmp', 'dist']));
// Build Production Files, the Default Task
gulp
.
task
(
'
default
'
,
[
'
clean
'
],
function
(
cb
)
{
runSequence
([
'
styles
'
,
'
copy
'
],
[
'
jshint
'
,
'
html
'
,
'
images
'
],
cb
);
runSequence
([
'
styles
'
,
'
copy
'
],
[
'
jshint
'
,
'
html
'
,
'
images
'
],
cb
);
});
// Run PageSpeed Insights
// Update `url` below to the public URL for your site
gulp
.
task
(
'
pagespeed
'
,
pagespeed
.
bind
(
null
,
{
// By default, we use the PageSpeed Insights
// free (no API key) tier. You can use a Google
// Developer API key if you have one. See
// http://goo.gl/RkN0vE for info key: 'YOUR_API_KEY'
url
:
'
https://todomvc.com
'
,
strategy
:
'
mobile
'
// By default, we use the PageSpeed Insights
// free (no API key) tier. You can use a Google
// Developer API key if you have one. See
// http://goo.gl/RkN0vE for info key: 'YOUR_API_KEY'
url
:
'
https://todomvc.com
'
,
strategy
:
'
mobile
'
}));
gulp
.
task
(
'
serve
'
,
function
(
cb
)
{
app
.
listen
(
8080
,
cb
);
app
.
listen
(
8080
,
cb
);
});
Write
Preview
Markdown
is supported
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