node package manager

front-end-builder

Front-end builder

package.json scripts:

{
    "build": "node ./node_modules/front-end-builder production",
    "builder": "node ./node_modules/front-end-builder production listen",
    "build-dev": "node ./node_modules/front-end-builder development",
    "builder-dev": "node ./node_modules/front-end-builder development listen"
}

front-end-builder.config.js keys:

  • rmdir

    [ "public" ]

    Will remove specific dirs recursively

  • pug

    {
        "public": {
            "build": {
                "src": [ "src/views/**/*.pug", "!src/views/hide/**/*.pug" ],
                "dest": "public"
            },
            "watch": {
                "src": "src/views/**/*.pug"
            }
        }
    }
  • pug_js

  • js

    {
        "public": {
            "build": {
                "src": "src/js/**/*.js",
                "dest": "public/js",
                "concat": "bundle"
            }
        },
       "angularjs": {
           "build": {
               "src": [
                   "src/angular/modules/**/*",
                   "src/angular/apps/**/*",
                   "src/angular/configs/**/*",
                   "src/angular/controllers/**/*",
                   "src/angular/directives/**/*",
                   "src/angular/components/**/*",
                   "src/angular/filters/**/*",
                   "src/angular/services/**/*"
               ],
               "dest": "public/angular",
               "map": true,
               "concat": {
                   "iife": {
                       "prepend": ["angular","moment"],
                       "append": ["window.angular","window.moment"]
                   },
                   "name": "main.bundle"
               }
           }
       }
    }
  • ts

  • stylus

    {
        "public": {
            "build": {
                "src": "src/css/**/*.*",
                "dest": "public/css",
                "map": true,
                "concat": "main.bundle"
            }
        }
    }
  • components

    • js

      {
          "main": {
            "src": [
                "src/bower/jquery/dist/jquery.min",
                "src/bower/moment/min/moment.min",
                "src/bower/angular/angular.min",
                "src/bower/angular-ui-router/release/angular-ui-router.min"
            ],
            "dest": "public/js",
            "concat": "core"
        }
      }
    • css

      {
          "main": {
            "src": [
                "src/bower/components-font-awesome/css/font-awesome.min"
            ],
            "dest": "public/css",
            "concat": "core"
        }
      }
    • fonts

      {
          "public": {
            "src": [
                "src/fonts/**/*",
                "src/bower/components-font-awesome/fonts/*"
            ],
            "dest": "public/fonts"
        }
      }
    • images

      {
          "public": {
              "src": "src/images/**/*",
               "dest": "public/images"
          }
      }
    • other

      {
         "ckeditor": {
             "src": ["src/bower/ckeditor/**/*", "!src/bower/ckeditor/samples/**/*"],
             "dest": "public/components/ckeditor"
         }
      }