Browse Source

added build script via npm and updated readme

Signed-off-by: Raj <charanraj.tc@gmail.com>
Raj 7 years ago
parent
commit
82db1757ed
2 changed files with 22 additions and 3 deletions
  1. 14 3
      README.md
  2. 8 0
      package.json

+ 14 - 3
README.md

@@ -157,22 +157,33 @@ Custom Error-Codes used by e.g. CloudFlare
 ```
 
 ### Build/Generator ###
+* Install packages using npm or yarn and have php in your executable path* 
 Used Naming-Scheme: `HTTP#CODE#.html` (customizable by editing the `config.ini`)
 To generate the static html pages, run the `generator.php` script:
 
 ```shell
-php generator.php
+npm run generate-php
 ```
 
 All generated html files are located into the `dist/` directory by default.
 
 ### Compile LESS Files ###
-To rebuild the LESS files run the **ANT** build script (requires lessc in your path):
+To rebuild the LESS files run the :
 
 ```shell
-ant css
+npm run generate-css
 ```
 
+### Build all ###
+
+```shell
+npm run generate
+```
+
+
+### Less CSS ### 
+
+Modify the `assets/Layout.less` to make your own design styles (Make sure to run build scripts after editing the files)
 
 ### Configuration ###
 

+ 8 - 0
package.json

@@ -2,6 +2,11 @@
   "name": "http-error-pages",
   "version": "0.5.2",
   "description": "Simple HTTP Error Pages for expressjs",
+  "scripts":{
+    "generate-css":"lessc assets/Layout.less assets/Layout.css",
+    "generate-html":"php generator.php",
+    "generate": "npm run generate-css && npm run generate-html"
+  },
   "keywords": [
     "http",
     "https",
@@ -29,5 +34,8 @@
   "license": "MIT",
   "devDependencies": {
     "express": "^4.15.2"
+  },
+  "dependencies": {
+    "less": "^2.7.3"
   }
 }