diff --git a/.gitignore b/.gitignore index 799cdca..d6668ba 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ public/ .cache/ dist/ +dev/ **/*.log config.json \ No newline at end of file diff --git a/package.json b/package.json index b180dec..50ce68b 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,14 @@ "author": "Robbie Antenesse ", "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", diff --git a/process-images.js b/process-images.js index 80531af..e783cfb 100644 --- a/process-images.js +++ b/process-images.js @@ -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);