mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
- minify js and css
This commit is contained in:
parent
2cbb719855
commit
69f4795f06
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,3 +3,6 @@
|
||||
/bin/
|
||||
/.shards/
|
||||
*.dwarf
|
||||
node_modules
|
||||
yarn.lock
|
||||
dist
|
||||
|
8
Makefile
8
Makefile
@ -1,4 +1,12 @@
|
||||
build:
|
||||
yarn
|
||||
yarn uglify
|
||||
shards install
|
||||
crystal build src/mango.cr --release --progress
|
||||
run:
|
||||
crystal run src/mango.cr --error-trace
|
||||
clean:
|
||||
rm mango
|
||||
rm -rf dist
|
||||
rm yarn.lock
|
||||
rm -rf node_modules
|
||||
|
17
gulpfile.js
Normal file
17
gulpfile.js
Normal file
@ -0,0 +1,17 @@
|
||||
const gulp = require('gulp');
|
||||
const uglify = require('gulp-uglify');
|
||||
const minifyCss = require('gulp-minify-css');
|
||||
|
||||
gulp.task('minify-js', () => {
|
||||
return gulp.src('public/js/*.js')
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('dist/js'));
|
||||
});
|
||||
|
||||
gulp.task('minify-css', () => {
|
||||
return gulp.src('public/css/*.css')
|
||||
.pipe(minifyCss())
|
||||
.pipe(gulp.dest('dist/css'));
|
||||
});
|
||||
|
||||
gulp.task('default', gulp.parallel('minify-js', 'minify-css'));
|
16
package.json
Normal file
16
package.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "mango",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/hkalexling/Mango.git",
|
||||
"author": "Alex Ling <hkalexling@gmail.com>",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-minify-css": "^1.2.4",
|
||||
"gulp-uglify": "^3.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"uglify": "gulp"
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ require "./util"
|
||||
|
||||
class FS
|
||||
extend BakedFileSystem
|
||||
bake_folder "../public"
|
||||
bake_folder "../dist"
|
||||
end
|
||||
|
||||
class StaticHandler < Kemal::Handler
|
||||
|
Loading…
x
Reference in New Issue
Block a user