Change image processing

This commit is contained in:
Robbie Antenesse 2019-09-08 21:45:35 -06:00
parent d5de474368
commit 79c812c684
3 changed files with 12 additions and 11 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@ node_modules/
public/
.cache/
dist/
dev/
**/*.log
config.json

View File

@ -7,14 +7,14 @@
"author": "Robbie Antenesse <dev@alamantus.com>",
"license": "MIT",
"scripts": {
"install": "npm run process-images",
"dev": "npm run watch-js",
"start": "npm run build && npm run serve",
"watch-js": "parcel watch app/index.html --out-dir public --no-hmr --no-cache",
"serve": "node server/index.js",
"build": "parcel build app/index.html --out-dir public --no-source-maps",
"clear": "npm run clear-dist && npm run clear-cache",
"clear-dist": "rimraf dist/{*,.*}",
"clear-cache": "rimraf .cache/{*,.*}"
"build": "parcel build app/index.html --out-dir public --no-source-maps --no-cache",
"process-images": "node ./process-images.js",
"clear": "rimraf public/{*,.*}"
},
"devDependencies": {
"autoprefixer": "^9.6.1",
@ -27,8 +27,8 @@
"sharp": "^0.23.0"
},
"dependencies": {
"cross-env": "^5.2.1",
"choo": "^7.0.0",
"cross-env": "^5.2.1",
"fastify": "^2.8.0",
"fastify-caching": "^5.0.0",
"fastify-compress": "^0.11.0",

View File

@ -1,16 +1,16 @@
const fs = require('fs');
const sharp = require('sharp');
const folder = './public/images/';
const folder = './dev/images/';
if (!fs.existsSync('./public')) {
fs.mkdirSync('./public');
if (!fs.existsSync('./dev')) {
fs.mkdirSync('./dev');
}
if (!fs.existsSync('./public/images')) {
fs.mkdirSync('./public/images');
if (!fs.existsSync('./dev/images')) {
fs.mkdirSync('./dev/images');
}
const favicon = sharp('./images/book-pile.svg');
const favicon = sharp('./app/images/book-pile.svg');
// sharp('./src/images/social.jpg').toFile(folder + 'social.jpg', (err, info) => {
// if (err) return console.error(err);