Grunt2Gulp

parent ecb8776d
Pipeline #8576030 failed with stage
in 56 seconds
/vendor
/node_modules
.sass-cache
.project
.settings/
/public
.yo-rc.json
/bower_components
image: node:6.6.0
image: node:6.6.0
pages:
stage: deploy
stage: deploy
script:
- npm install -g bower grunt-cli
- bower install --allow-root
- npm install -g gulp-cli
- npm install
- grunt public:dev
- gulp public
artifacts:
paths:
- public
......
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
htmlhint: {
options: {
'attr-lower-case': true,
'attr-value-not-empty': false,
'tag-pair': true,
'tag-self-close': false,
'tagname-lowercase': true,
'id-class-value': true,
'id-unique': true,
'img-alt-require': true,
'img-alt-not-empty': true
},
main: {
src: ['public/**.html']
}
},
jshint: {
main: {
files: [{
src: ['Gruntfile.js', 'js/**.js']
}]
},
options: {
globals: {
'jQuery': true,
'console': true
}
}
},
copy: {
fonts: {
expand: true,
files: [{
expand: true,
cwd: 'bower_components/font-awesome/fonts',
src: "**",
dest: 'public/fonts'
},
{
expand: true,
cwd: 'bower_components/bootstrap/fonts',
src: "**",
dest: 'public/fonts'
},
{
expand: true,
cwd: 'bower_components/fonts-smc/fonts',
src: "**",
dest: 'public/fonts'
}
]
},
iejs: {
expand: true,
files: [{
expand: true,
cwd: 'bower_components/html5shiv/dist',
src: "**",
dest: 'public/js'
},
{
expand: true,
cwd: 'bower_components/respond/src',
src: "**",
dest: 'public/js'
}
]
},
prereqs: {
expand: true,
files: [{
expand: true,
cwd: '_',
src: "**",
dest: 'public/_'
}]
}
},
pug: {
options: {
pretty: true,
data: {
debug: true
}
},
pages: {
files: [{
expand: true,
cwd: 'pug/pages',
src: '*.pug',
dest: 'public/',
ext: '.html'
}]
}
},
uglify: {
compress: {
files: {
'public/js/index.js': [
'js/*.js'
],
'public/js/vendor.js': [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/bootstrap/dist/js/bootstrap.min.js'
]
},
options: {
mangle: true,
unused: true
}
}
},
cssmin: {
options: {
sourceMap: true
},
compress: {
files: {
'public/css/index.css': [
'css/*.css'
],
'public/css/vendor.css': [
'bower_components/smc-fonts/css/fonts.css',
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/font-awesome/css/font-awesome.min.css',
'bower_components/normalize-css/normalize.css'
]
}
}
},
watch: {
grunt: {
files: ['Gruntfile.js'],
options: {
nospawn: true,
keepalive: true,
livereload: true
},
tasks: ['public:dev']
},
html: {
files: ['public/*.html'],
options: {
nospawn: true,
keepalive: true,
livereload: true
},
tasks: ['htmlhint']
},
js: {
files: 'js/**',
options: {
nospawn: true,
livereload: true
},
tasks: ['jshint', 'uglify']
},
pug: {
files: ['pug/**'],
options: {
nospawn: true,
livereload: true
},
tasks: ['pug']
},
css: {
files: 'css/**',
options: {
nospawn: true,
livereload: true
},
tasks: ['cssmin']
}
},
connect: {
server: {
options: {
port: 8080,
base: 'public',
hostname: 'localhost',
livereload: true
}
}
}
});
grunt.registerTask('public:dev', function(target) {
grunt.task.run([
'pug',
'htmlhint',
'jshint',
'copy',
'uglify',
'cssmin'
]);
});
grunt.registerTask('serve', function(target) {
grunt.task.run([
'public:dev',
'connect',
'watch'
]);
});
};
{
"name": "shrimadhav_u_k",
"authors": [
"Shrimadhav U K <[email protected]>"
],
"description": "SpEcHiDe is what SpEcHiDe does",
"license": "GPL-3.0",
"homepage": "https://www.shrimadhavuk.me/",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": "^3.3.7",
"normalize-css": "normalize.css#4.1.1",
"font-awesome": "^4.7.0",
"jquery": "2.2.4",
"html5shiv": "3.7.0",
"respond": "https://github.com/scottjehl/Respond.git#1.4.0",
"fonts-smc": "#*"
}
}
var gulp = require('gulp');
var htmlhint = require('gulp-htmlhint');
var jshint = require('gulp-jshint');
var csslint = require('gulp-csslint');
var pug = require('gulp-pug');
var concat = require('gulp-concat');
var cssmin = require('gulp-cssmin');
var uglify = require('gulp-uglify');
var connect = require('gulp-connect');
var connectProxy = require('gulp-connect-proxy');
gulp.task('assetscopy', function() {
gulp.src([
'_/key.asc',
'_/OpenKeyChain.proof'
]).pipe(gulp.dest('public/_'));
gulp.src([
'node_modules/font-awesome/fonts/*.{ttf,woff,eot,svg,woff2,otf}',
'node_modules/bootstrap/fonts/*.{ttf,woff,eot,svg, woff2}',
'node_modules/smc-fonts/fonts/**/*.{ttf,woff,woff2}'
]).pipe(gulp.dest('public/fonts'));
});
gulp.task('htmllint', function() {
gulp.src("public/*.html")
.pipe(htmlhint());
});
gulp.task('csslint', function() {
gulp.src('css/*.css')
.pipe(csslint({
'shorthand': false
}))
.pipe(csslint.formatter());
});
gulp.task('jslint', function() {
gulp.src(["Gruntfile.js", "js/*.js"])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('pughtml', function() {
gulp.src('pug/pages/*.pug')
.pipe(pug({
pretty: true,
data: {
debug: true
}
}))
.pipe(gulp.dest('public'))
});
gulp.task('cssmin', function() {
gulp.src('css/*.css')
.pipe(concat('index.css'))
.pipe(cssmin())
.pipe(gulp.dest('public/css'));
gulp.src([
'node_modules/smc-fonts/css/fonts.css',
'node_modules/bootstrap/dist/css/bootstrap.min.css',
'node_modules/font-awesome/css/font-awesome.min.css',
'node_modules/normalize-css/normalize.css'
])
.pipe(concat('vendor.css'))
.pipe(cssmin())
.pipe(gulp.dest('public/css'));
});
gulp.task('jsuglify', function() {
gulp.src('js/*.js')
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'));
gulp.src([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js'
]).pipe(concat('vendor.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'));
gulp.src([
'node_modules/html5shiv/dist/html5shiv.js',
'node_modules/Respond.js/src/respond.js'
])
.pipe(uglify())
.pipe(gulp.dest('public/js'));
});
gulp.task('public', [
'assetscopy',
'pughtml',
'htmllint',
'jslint',
'jsuglify',
// 'csslint',
'cssmin'
]);
gulp.task('connect', function() {
connect.server({
root: 'public',
port: 8080,
livereload: true
});
});
gulp.task('watch', function() {
gulp.watch([
'./pug/**/*.pug'
], [
'pughtml',
'htmllint',
]);
gulp.watch([
'css/*.css',
'bower.json'
], [
// 'csslint',
'cssmin'
]);
gulp.watch([
'js/*.js',
'bower.json'
], [
'jslint',
'jsuglify',
]);
});
gulp.task('serve', [
'public',
'connect',
'watch'
]);
gulp.task('default', [
'serve'
]);
......@@ -11,26 +11,27 @@
},
"homepage": "https://gitlab.com/spechide/spechide.gitlab.io#README",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-htmlhint": "^0.3.1",
"gulp-csslint": "^1.0.0",
"gulp-jshint": "^2.0.4",
"gulp-pug": "^3.3.0",
"gulp-cssmin": "^0.2.0",
"gulp-uglify": "^3.0.0",
"gulp-concat": "^2.6.1",
"gulp-connect": "^5.0.0",
"gulp-connect-proxy": "^0.3.1",
"connect-livereload": "^0.5.4",
"grunt": "^0.4.5",
"grunt-connect-proxy": "^0.2.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-nodeunit": "^0.4.1",
"grunt-contrib-uglify": "^0.5.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-htmlhint": "^0.9.13",
"grunt-preprocess": "^5.1.0",
"jshint-stylish": "^2.2.1",
"load-grunt-tasks": "^3.5.0",
"time-grunt": "^1.3.0",
"grunt-contrib-pug": "^1.0.0",
"jstransformer-markdown-it": "^2.0.0"
},
"dependencies": {},
"dependencies": {
"bootstrap": "^3.3.7",
"font-awesome": "^4.7.0",
"html5shiv": "^3.7.3",
"jquery": "^3.2.1",
"normalize.css": "^7.0.0",
"Respond.js": "git+https://github.com/scottjehl/Respond.git#1.4.0",
"smc-fonts": "git+https://gitlab.com/smc/smc-fonts-bower.git"
},
"author": "Shrimadhav U K <[email protected]>",
"license": "GPL-3.0"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment