Init repo
This commit is contained in:
28
.gitignore
vendored
Normal file
28
.gitignore
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/node,macos,windows,linux
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
out
|
||||
|
||||
# Intermediate CSS directory
|
||||
src/css
|
||||
|
||||
### macOS ###
|
||||
*.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
### Windows ###
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# JetBrains WebStrom
|
||||
.idea
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Marcin Krzemiński
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
106
gulpfile.js
Normal file
106
gulpfile.js
Normal file
@@ -0,0 +1,106 @@
|
||||
var gulp = require('gulp');
|
||||
var browserSync = require('browser-sync');
|
||||
var sass = require('gulp-sass');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
var autoprefixer = require('gulp-autoprefixer');
|
||||
var cleanCSS = require('gulp-clean-css');
|
||||
var uglify = require('gulp-uglify');
|
||||
var concat = require('gulp-concat');
|
||||
var imagemin = require('gulp-imagemin');
|
||||
var changed = require('gulp-changed');
|
||||
var htmlReplace = require('gulp-html-replace');
|
||||
var htmlMin = require('gulp-htmlmin');
|
||||
var del = require('del');
|
||||
var sequence = require('run-sequence');
|
||||
|
||||
var config = {
|
||||
dist: 'out/',
|
||||
src: 'src/',
|
||||
|
||||
cssIn: 'src/css/**/*.css',
|
||||
jsIn: 'src/js/**/*.js',
|
||||
imgIn: 'src/img/**/*.{jpg,jpeg,png,gif}',
|
||||
htmlIn: 'src/*.html',
|
||||
scssIn: 'src/scss/**/*.scss',
|
||||
|
||||
cssOut: 'out/css/',
|
||||
jsOut: 'out/js/',
|
||||
imgOut: 'out/img/',
|
||||
htmlOut: 'out/',
|
||||
scssOut: 'src/css/',
|
||||
cssOutName: 'style.css',
|
||||
jsOutName: 'script.js',
|
||||
cssReplaceOut: 'css/style.css',
|
||||
jsReplaceOut: 'js/script.js'
|
||||
};
|
||||
|
||||
gulp.task('reload', function() {
|
||||
browserSync.reload();
|
||||
});
|
||||
|
||||
gulp.task('serve', function() {
|
||||
browserSync({
|
||||
server: config.dist
|
||||
});
|
||||
|
||||
gulp.watch(config.htmlIn, function() { sequence('html', 'reload') });
|
||||
gulp.watch(config.scssIn, function() { sequence('sass', 'css', 'reload') });
|
||||
gulp.watch(config.jsIn, function() { sequence('js', 'reload') });
|
||||
});
|
||||
|
||||
gulp.task('sass', function() {
|
||||
return gulp.src(config.scssIn)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(sass().on('error', sass.logError))
|
||||
.pipe(autoprefixer({
|
||||
browsers: ['last 3 versions']
|
||||
}))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(config.scssOut))
|
||||
.pipe(browserSync.stream());
|
||||
});
|
||||
|
||||
gulp.task('css', function() {
|
||||
return gulp.src(config.cssIn)
|
||||
.pipe(concat(config.cssOutName))
|
||||
.pipe(cleanCSS())
|
||||
.pipe(gulp.dest(config.cssOut));
|
||||
});
|
||||
|
||||
gulp.task('js', function() {
|
||||
return gulp.src(config.jsIn)
|
||||
.pipe(concat(config.jsOutName))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest(config.jsOut));
|
||||
});
|
||||
|
||||
gulp.task('img', function() {
|
||||
return gulp.src(config.imgIn)
|
||||
.pipe(changed(config.imgOut))
|
||||
.pipe(imagemin())
|
||||
.pipe(gulp.dest(config.imgOut));
|
||||
});
|
||||
|
||||
gulp.task('html', function() {
|
||||
return gulp.src(config.htmlIn)
|
||||
.pipe(htmlReplace({
|
||||
'css': config.cssReplaceOut,
|
||||
'js': config.jsReplaceOut
|
||||
}))
|
||||
.pipe(htmlMin({
|
||||
sortAttributes: true,
|
||||
sortClassName: true,
|
||||
collapseWhitespace: true
|
||||
}))
|
||||
.pipe(gulp.dest(config.htmlOut))
|
||||
});
|
||||
|
||||
gulp.task('clean', function() {
|
||||
return del([config.dist]);
|
||||
});
|
||||
|
||||
gulp.task('build', function() {
|
||||
sequence('clean', ['html', 'js', 'css', 'img']);
|
||||
});
|
||||
|
||||
gulp.task('default', sequence('build', 'serve'));
|
||||
8146
package-lock.json
generated
Normal file
8146
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
Normal file
23
package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "ForkIO",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"author": "Bartłomiej Pluta",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"browser-sync": "^2.17.5",
|
||||
"del": "^2.2.2",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^3.1.1",
|
||||
"gulp-changed": "^1.3.2",
|
||||
"gulp-clean-css": "^2.0.13",
|
||||
"gulp-concat": "^2.6.0",
|
||||
"gulp-html-replace": "^1.6.1",
|
||||
"gulp-htmlmin": "^3.0.0",
|
||||
"gulp-imagemin": "^3.0.3",
|
||||
"gulp-sass": "^2.3.2",
|
||||
"gulp-sourcemaps": "^2.1.1",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"run-sequence": "^1.2.2"
|
||||
}
|
||||
}
|
||||
17
src/index.html
Normal file
17
src/index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gulp Starter Kit</title>
|
||||
<!-- build:css -->
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<!-- endbuild -->
|
||||
</head>
|
||||
<body>
|
||||
<h1>Gulp starter kit</h1>
|
||||
<!-- build:js -->
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/script.js"></script>
|
||||
<!-- endbuild -->
|
||||
</body>
|
||||
</html>
|
||||
1
src/js/plugins.js
Normal file
1
src/js/plugins.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log('plugins');
|
||||
1
src/js/script.js
Normal file
1
src/js/script.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log('script');
|
||||
1
src/scss/_settings.scss
Normal file
1
src/scss/_settings.scss
Normal file
@@ -0,0 +1 @@
|
||||
$color-bg: green;
|
||||
5
src/scss/style.scss
Normal file
5
src/scss/style.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
@import "settings";
|
||||
|
||||
body {
|
||||
background-color: $color-bg;
|
||||
}
|
||||
Reference in New Issue
Block a user