mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-10 01:42:19 +02:00
Improve gulp implementation
This commit is contained in:
parent
00fa95823e
commit
10bbf55c6e
15
gulpfile.js
15
gulpfile.js
|
@ -1,7 +1,16 @@
|
|||
var gulp = require('gulp'),
|
||||
minifycss = require('gulp-minify-css'),
|
||||
uglify = require('gulp-uglify'),
|
||||
concat = require('gulp-concat');
|
||||
concat = require('gulp-concat'),
|
||||
header = require('gulp-header'),
|
||||
pkg = require('./package.json');
|
||||
|
||||
var banner = ['/**',
|
||||
' * <%= pkg.name %> v<%= pkg.version %>',
|
||||
' * @link <%= pkg.homepage %>',
|
||||
' * @license <%= pkg.license %>',
|
||||
' */',
|
||||
''].join('\n');
|
||||
|
||||
gulp.task('scripts', function() {
|
||||
var js_files = [
|
||||
|
@ -18,9 +27,11 @@ gulp.task('scripts', function() {
|
|||
'./src/js/simplemde.js'];
|
||||
|
||||
return gulp.src(js_files)
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(concat('simplemde.min.js'))
|
||||
.pipe(gulp.dest('dist'))
|
||||
.pipe(uglify())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
|
@ -29,8 +40,8 @@ gulp.task('styles', function() {
|
|||
.pipe(concat('simplemde.min.css'))
|
||||
.pipe(gulp.dest('dist'))
|
||||
.pipe(minifycss())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['scripts', 'styles']);
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
{
|
||||
"name" : "simplemde-markdown-editor",
|
||||
"name": "SimpleMDE",
|
||||
"main": "gulpfile.js",
|
||||
"version": "1.5.1",
|
||||
"homepage": "https://github.com/NextStepWebs/simplemde-markdown-editor",
|
||||
"license": "MIT license",
|
||||
"dependencies": {
|
||||
"gulp": "*",
|
||||
"gulp-minify-css": "*",
|
||||
"gulp-uglify": "*",
|
||||
"gulp-concat" : "*"
|
||||
"gulp-concat": "*",
|
||||
"gulp-header": "*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in a new issue