4.2.0 • Published 6 years ago

@khalidhoffman/kdev-utils v4.2.0

Weekly downloads
-
License
-
Repository
github
Last release
6 years ago

kdev-utils Build Status

A cli/gulp library for quicker front-end development

How To Use

  1. run npm i -g @khalidhoffman/kdev-utils for kdev cli (or without -g via package.json script).
  2. Run kdev from root folder to see list of tasks.
  3. Run kdev setup to generate project kdev.config.json file

Example Config

{
  "name": "project_name"
  "avocode" : {
      "userSelector": "User's Full Name",
      "projectSelector": "Project_name_to_match_against"
  },
  "workingDir" "/an/absolute/path|default|wordpress",
  "tasks" : [
    {
      "name" : "stylus",
      "input": "relative/path/to/stylus/folder/from/workingDir",
      "output": "relative/path/to/stylesheets/folder/from/workingDir"
    },
    {
      "name" : "pug-php",
      "input": "relative/path/to/pug/folder/from/workingDir",
      "output": "relative/path/to/php/folder/from/workingDir",
      "options": {
        "pretty": true
      }
    },
    {
      "name" : "jsx",
      "input": "relative/path/to/jsx/folder/from/workingDir",
      "options": {
        "ignore": ["glob/pattern/to/ignore", "**/node_modules/**"]
       }
    }
  ]
}
Config Details
  • All paths are relative to workingDir. workingDir is an absolute path.
  • workingDir when set to "default", uses the process.cwd() (the current working directory)
  • jsx, stylus, less, and js tasks support options.ignore field which is a glob pattern to exclude
Task Options
Task NamesDetails
pug-phpadditional helper functions are saved and included before compilation. compiles to .php files
pug-ejsadditional helper functions are saved and included before compilation. compiles to .ejs files
pug-htmladditional helper functions are saved and included before compilation. compiles to .html files
stylusadditional helper functions are included at compilation. compiles to css
stylus-bemadditional helper functions are included at compilation. compiles to css. Read more about stylus-bem
sasscompiles to css
compasscompiles to css
lesscompiles less to css. will prompt for filename.
cssminifies css with cssnano. Will rewrite files with .min.css extension. Accepts path to single file or folder relative to workingDir for input
jsbeautifies js, overwriting file
rjsbundles and minfies with requirejs. input path should be a path to a requirejs config build.js
webpackbundles with webpack. input path should be a path to a webpack config file
jsxcompiles to .js in same directory as original .jsx file
html2pugcompiles .html files to .pug files
php2pugcompiles .php files to .pug files
ts/cleanremoves typescript build files (.js, .d.ts)