Skip to content

Commit

Permalink
go to gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Nov 24, 2016
1 parent 1575f9f commit f20368f
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Check browser
Check browser version and show pop-up if version is less then recommended

bower i
npm i
19 changes: 19 additions & 0 deletions gulp/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
paths: {
pug: 'demo/index.pug',
pugWatch: [
'demo/index.pug',
],
styl: [
'stylesheets/old-browser.styl'
],
stylWatch: [
'src/blocks/**/*.styl'
],
copy: ['bower_components/prism/prism.js', 'bower_components/prism/themes/prism.css', 'src/check-browser.js'],
build: 'build/'
},
names: {
css: 'app.min.css'
}
};
28 changes: 28 additions & 0 deletions gulp/tasks/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const gulp = require('gulp'),
config = require('../config'),
plugins = require('gulp-load-plugins')();

const build = gulp.parallel(html, css, copy);

module.exports = build;

function html() {
return gulp.src(config.paths.pug)
.pipe(plugins.pug({
pretty: true
}))
.pipe(gulp.dest(config.paths.build));
}

function css() {
return gulp.src(config.paths.styl)
.pipe(plugins.stylus({
'include css': true
}))
.pipe(gulp.dest(config.paths.build));
}

function copy() {
return gulp.src(config.paths.copy)
.pipe(gulp.dest(config.paths.build));
}
5 changes: 5 additions & 0 deletions gulp/tasks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = require('require-dir')('.', {
camelcase: true,
recurse: true
}
);
19 changes: 19 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const gulp = require('gulp'),
del = require('del'),
// config = require('./gulp/config'),
tasks = require('./gulp/tasks'),
plugins = require('gulp-load-plugins')();

gulp.task('build', tasks.build);

const clean = () => del(['build']);

exports.clean = clean;

// gulp.task('deploy', () =>
// gulp.src(paths.dist + '**/*')
// .pipe(plugins.ghPages())
// );

// The default task (called when you run `gulp` from cli)
gulp.task('default', tasks.build);
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
"description": "script to check browser version",
"main": "src/check-browser.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"pug": "pug demo --out build",
"stylus": "stylus stylesheets/old-browser.styl -o build",
"copy1": "cp bower_components/prism/prism.js build",
"copy2": "cp bower_components/prism/themes/prism.css build",
"copy3": "cp src/check-browser.js build",
"build": "npm run pug && npm run stylus && npm run copy1 && npm run copy2 && npm run copy3",
"clean": "rm -rf build"
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
Expand All @@ -27,8 +20,14 @@
},
"homepage": "https://github.com/pure-js/check-browser#readme",
"devDependencies": {
"del": "^2.2.2",
"gulp-load-plugins": "^1.4.0",
"jshint": "^2.8.0",
"pug": "^2.0.0-beta2",
"stylus": "^0.54.5"
"require-dir": "^0.3.1"
},
"dependencies": {
"gulp": "github:gulpjs/gulp#4.0",
"gulp-pug": "^3.1.0",
"gulp-stylus": "^2.6.0"
}
}

0 comments on commit f20368f

Please sign in to comment.