Change image processing
This commit is contained in:
parent
d5de474368
commit
79c812c684
|
@ -2,6 +2,7 @@ node_modules/
|
|||
public/
|
||||
.cache/
|
||||
dist/
|
||||
dev/
|
||||
|
||||
**/*.log
|
||||
config.json
|
10
package.json
10
package.json
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue