PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.7.1
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.7.1
2.7.7 2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 All 28 releases
insert-php / admin / assets / gulpfile.js

gulpfile.js in Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts 2.7.1, at admin/assets/gulpfile.js

47 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 let gulp = require('gulp'),
2 less = require('gulp-less'),
3 concat = require('gulp-concat'),
4 minify = require('gulp-minify-css');
5
6 // Less files to be concat and minified together for CodeMirror
7 let CM_LESS_PATHS = ['css/general.less'];
8
9 // All other Less files to be compiled individually (excluding CM files)
10 let LESS_FILES = [
11 'css/code-editor-style.less',
12 'css/list-table.less',
13 'css/snippet-edit.less',
14 'css/snippet-preview.less',
15 'css/snippets-table.less'
16 ];
17
18 /**
19 * Compiles all CSS tasks: CodeMirror bundle and individual Less files.
20 *
21 * Execution: gulp build-css
22 */
23 gulp.task('build-css', function (done) {
24 // CodeMirror bundled CSS
25 let cmTask = gulp.src(CM_LESS_PATHS)
26 .pipe(less())
27 .pipe(concat('less-files.less'))
28 .pipe(concat('ccm.min.css'))
29 .pipe(minify())
30 .pipe(gulp.dest('dist/css'));
31
32 // Individual Less files
33 let lessTask = gulp.src(LESS_FILES)
34 .pipe(less())
35 .pipe(gulp.dest('css'));
36
37 return Promise.all([cmTask, lessTask]).then(() => done());
38 });
39
40 /**
41 * Watch for changes in Less files and compile automatically.
42 *
43 * Execution: gulp watch-css
44 */
45 gulp.task('watch-css', function () {
46 gulp.watch([...CM_LESS_PATHS, ...LESS_FILES], gulp.series('build-css'));
47 });