Skip to content

Commit d664f46

Browse files
committed
Added gulp
1 parent 5e51442 commit d664f46

File tree

6 files changed

+172
-6
lines changed

6 files changed

+172
-6
lines changed

.gitignore

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Created by https://www.gitignore.io/api/node,webstorm,sublimetext
2+
### Node ###
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
16+
.grunt
17+
# node-waf configuration
18+
.lock-wscript
19+
# Compiled binary addons (http://nodejs.org/api/addons.html)
20+
build/Release
21+
# Dependency directory
22+
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
23+
node_modules
24+
# Optional npm cache directory
25+
.npm
26+
# Optional REPL history
27+
.node_repl_history
28+
### WebStorm ###
29+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
30+
*.iml
31+
## Directory-based project format:
32+
.idea/
33+
# if you remove the above rule, at least ignore the following:
34+
# User-specific stuff:
35+
# .idea/workspace.xml
36+
# .idea/tasks.xml
37+
# .idea/dictionaries
38+
# .idea/shelf
39+
# Sensitive or high-churn files:
40+
# .idea/dataSources.ids
41+
# .idea/dataSources.xml
42+
# .idea/sqlDataSources.xml
43+
# .idea/dynamic.xml
44+
# .idea/uiDesigner.xml
45+
# Gradle:
46+
# .idea/gradle.xml
47+
# .idea/libraries
48+
# Mongo Explorer plugin:
49+
# .idea/mongoSettings.xml
50+
## File-based project format:
51+
*.ipr
52+
*.iws
53+
## Plugin-specific files:
54+
# IntelliJ
55+
/out/
56+
# mpeltonen/sbt-idea plugin
57+
.idea_modules/
58+
# JIRA plugin
59+
atlassian-ide-plugin.xml
60+
# Crashlytics plugin (for Android Studio and IntelliJ)
61+
com_crashlytics_export_strings.xml
62+
crashlytics.properties
63+
crashlytics-build.properties
64+
fabric.properties
65+
### SublimeText ###
66+
# cache files for sublime text
67+
*.tmlanguage.cache
68+
*.tmPreferences.cache
69+
*.stTheme.cache
70+
# workspace files are user-specific
71+
*.sublime-workspace
72+
# project files should be checked into the repository, unless a significant
73+
# proportion of contributors will probably not be using SublimeText
74+
# *.sublime-project
75+
# sftp configuration file
76+
sftp-config.json

dist/scripts.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/styles.min.css

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
var gulp = require('gulp');
2+
var runSequence = require('run-sequence');
3+
var clean = require('gulp-clean');
4+
var concat = require('gulp-concat');
5+
var uglify = require('gulp-uglify');
6+
var cssnano = require('gulp-cssnano');
7+
8+
gulp.task('default', function() {
9+
// place code for your default task here
10+
});
11+
12+
gulp.task('build', function(callback) {
13+
runSequence(
14+
'build-clean',
15+
'build-js',
16+
'build-css',
17+
callback);
18+
});
19+
20+
gulp.task('build-clean', function() {
21+
return gulp.src('dist').pipe(clean());
22+
});
23+
24+
gulp.task('build-js', function() {
25+
gulp.src([
26+
'vendor/jspdf/jspdf.min.js',
27+
'vendor/sdate/sdate.js',
28+
'src/life-calendar.js',
29+
'src/app.js'
30+
])
31+
.pipe(concat('scripts.min.js'))
32+
.pipe(uglify())
33+
.pipe(gulp.dest('dist'))
34+
});
35+
36+
gulp.task('build-css', function() {
37+
return gulp.src([
38+
'vendor/bootstrap/css/bootstrap.min.css',
39+
'src/main.css'
40+
])
41+
.pipe(concat('styles.min.css'))
42+
.pipe(cssnano())
43+
.pipe(gulp.dest('dist'));
44+
});
45+

index.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>Life calendar</title>
7-
<link rel='stylesheet' href='vendor/bootstrap/css/bootstrap.min.css'>
8-
<link rel="stylesheet" href="src/main.css">
7+
<link rel='stylesheet' href='dist/styles.min.css?v=1.0'>
98
</head>
109
<body>
1110

@@ -62,9 +61,6 @@
6261

6362
</div>
6463

65-
<script src="vendor/sdate/sdate.js"></script>
66-
<script src="vendor/jspdf/jspdf.min.js"></script>
67-
<script src="src/life-calendar.js"></script>
68-
<script src="src/app.js"></script>
64+
<script src="dist/scripts.min.js?v=1.0"></script>
6965
</body>
7066
</html>

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "life-calendar",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"dependencies": {},
7+
"devDependencies": {
8+
"gulp": "^3.9.0",
9+
"gulp-clean": "^0.3.1",
10+
"gulp-concat": "^2.6.0",
11+
"gulp-cssnano": "^2.1.0",
12+
"gulp-uglify": "^1.5.1",
13+
"run-sequence": "^1.1.5"
14+
},
15+
"scripts": {
16+
"test": "echo \"Error: no test specified\" && exit 1"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/wcoder/life-calendar.git"
21+
},
22+
"keywords": [
23+
"life",
24+
"calendar"
25+
],
26+
"author": "Yauheni Pakala (https://github.com/wcoder)",
27+
"license": "MIT",
28+
"bugs": {
29+
"url": "https://github.com/wcoder/life-calendar/issues"
30+
},
31+
"homepage": "https://github.com/wcoder/life-calendar#readme"
32+
}

0 commit comments

Comments
 (0)