mirror of
https://github.com/Fechin/reference.git
synced 2026-11-20 21:23:11 +03:00
- Add comprehensive development tooling: * ESLint configuration with modern JavaScript rules * Prettier for consistent code formatting * Husky for Git hooks automation * lint-staged for pre-commit checks * Conventional Commits with commitlint * Stylelint for CSS code quality - Fix CSS issues: * Resolve duplicate selectors in layout_note.css * Merge duplicate selectors in layout_list.css * Ensure stylelint compliance - Apply consistent code formatting: * Format all JavaScript, CSS, and Markdown files * Standardize code style across the project * Fix console statement warnings in main.js - Update project documentation: * Enhance README with modern development practices * Update package.json with new scripts and dependencies This modernization establishes a robust development environment with automated code quality checks, consistent formatting~
45 lines
927 B
JavaScript
45 lines
927 B
JavaScript
const gulp = require('gulp');
|
|
const htmlmin = require('gulp-htmlmin');
|
|
const htmlclean = require('gulp-htmlclean');
|
|
const version = require('gulp-version-number');
|
|
const terser = require('gulp-terser');
|
|
|
|
// Compress js files
|
|
gulp.task('js', function () {
|
|
return gulp
|
|
.src(['./public/js/main.js'])
|
|
.pipe(
|
|
terser({
|
|
compress: true
|
|
})
|
|
)
|
|
.pipe(gulp.dest('./public/js'));
|
|
});
|
|
|
|
// Build html files
|
|
gulp.task('html', function () {
|
|
return gulp
|
|
.src('./public/**/*.html')
|
|
.pipe(htmlclean())
|
|
.pipe(
|
|
htmlmin({
|
|
removeComments: true,
|
|
minifyJS: true,
|
|
minifyCSS: true,
|
|
minifyURLs: true
|
|
})
|
|
)
|
|
.pipe(
|
|
version({
|
|
append: {
|
|
key: '_v',
|
|
cover: 1,
|
|
to: ['css', 'js', 'png', 'jpg', 'woff2']
|
|
}
|
|
})
|
|
)
|
|
.pipe(gulp.dest('./public'));
|
|
});
|
|
|
|
gulp.task('default', gulp.parallel('js', 'html'));
|