node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

curse-fe

curse-fe

npm i -g curse-fe

An all-in-one package for Curse, Inc's front-end devs

create curse-fe.json file:

{
  "sass": {
    "watch": [
      "project1/css",
      "project2/css"
    ],
    "compile": [
      "project1/css/core.scss",
      "project2/css/core.scss"
    ]
  },
  "react": {
    "entries": [
      "project1/js/react/app1",
      "project1/js/react/app2"
    ],
    "externals": {
      "external1": "External1",
      "external2": "External2"
    }
  },
  "browserSync": {
    "vhost": "url.tld",
    "files": [
      "bundle.js",
      "Cobalt/Content/js/**/*.js",
      "**/core.css"
    ]
  },
  "concatenate": {
    "files": [
      "js/*.js"
    ],
    "destination": [
      "js/dist"
    ]
  }
}

run curse-fe and let the magic happen!

Check Current Version:

check current version with curse-fe -v or curse-fe --version

BrowserSync:

To use BrowserSync, simply navigate to vhost:3000 after running curse-fe!

PostCSS

use PostCSS (currently only autoprefixer) with curse-fe postcss

note: this will be phased out as legacy code is cleaned up. future versions will have PostCSS on by default with curse-fe

Linting:

to lint a js/jsx file, run curse-fe lint FILE_NAME. it will return either the lint response, or nothing if the file is good to go!

JS Concatenation:

adding the concatenate object to your curse-fe.json file and adding the files/destination objects to it will concatenate the files in the files list and output the bundle to the destination folder.

Minification:

if you pass curse-fe minify it will minify your css and js concatenated bundle (if those objects are created in your curse-fe.json file). if you'd like to minify your PostCSS'd css, pass curse-fe minify postcss