Skip to content

Commit

Permalink
link, image support + mod structure
Browse files Browse the repository at this point in the history
  • Loading branch information
moinism committed Jul 1, 2017
1 parent 7951729 commit 79dc3ed
Show file tree
Hide file tree
Showing 9 changed files with 531 additions and 373 deletions.
22 changes: 22 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var fs = require('fs'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
pkg = require('./package.json'),
htmlclean = require('htmlclean'),
replace = require('gulp-replace'),
minify = require('gulp-clean-css');
Expand All @@ -20,12 +21,25 @@ function htmlTemplate() {
));
}

var comment = '/*\n' +
' * <%= pkg.name %> <%= pkg.version %>\n' +
' * <%= pkg.description %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright <%= year %>, <%= pkg.author %>\n' +
' * Released under the <%= pkg.license %> license.\n' +
'*/\n\n';

gulp.task('styles', function() {
gulp.src(['./src/styles/normal.scss',
'./src/styles/botui.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(minify())
.pipe(concat('botui.min.css'))
.pipe(banner(comment, {
pkg: pkg,
year: new Date().getFullYear()
}))
.pipe(gulp.dest('./build/'));
});

Expand All @@ -42,12 +56,20 @@ gulp.task('themes', function() {
gulp.task('scripts', function () {
gulp.src('./src/scripts/botui.js') // simply copy the original one
.pipe(htmlTemplate())
.pipe(banner(comment, {
pkg: pkg,
year: new Date().getFullYear()
}))
.pipe(gulp.dest('./build/'));

gulp.src('./src/scripts/botui.js') // minified version
.pipe(uglify())
.pipe(htmlTemplate())
.pipe(rename('botui.min.js'))
.pipe(banner(comment, {
pkg: pkg,
year: new Date().getFullYear()
}))
.pipe(gulp.dest('./build/'));
});

Expand Down
2 changes: 1 addition & 1 deletion build/botui-theme-default.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 79dc3ed

Please sign in to comment.