Skip to content

Instantly share code, notes, and snippets.

@pateketrueke
Created July 8, 2016 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pateketrueke/c36f806d9d99f746d81576cfb9bb82e4 to your computer and use it in GitHub Desktop.
Save pateketrueke/c36f806d9d99f746d81576cfb9bb82e4 to your computer and use it in GitHub Desktop.

Dependencies

  • npm i tarima-cli [engines] -ES

Where [engines] are the following described in the README.

{
  "scripts": {
    // build is intended only for production [f => force debug Verbose]
    "build": "tarima -fdV",
    // watch fits better for pure frontend workflows [ws => watch server]
    "watch": "tarima -wsdV",
    // proxy fits better for both back/front end workflows [wP = watch Proxy]
    "proxy": "tarima -wdVP localhost:3000"
  },
  "tarima": {
    // enable bundling for all sources through rollup.js (see filter below)
    "bundle": true,
    // all files to watch and/or process
    "src": "src/**/*",
    // where browser-sync will serve static files (no proxy)
    "public": "public",
    // a JSON manifest with all stats
    "cacheFile": "public/build.json",
    // destination file
    "dest": "build",
    // shortcut for "ignore"
    // "ignore": ["*.bak"],
    // include this files to list of ignores
    "ignoreFiles": [
      ".gitignore"
    ],
    // (see "bundle" above) determine which files are entry-points
    "filter": [
      "**/_{entries,templates}/**"
    ],
    // [GLOB]:[DEST]
    "rename": [
      // a/b/c => {value/1} => b/c
      // a/b/c => {value/b/x} => a/x/c
      // {filepath} => directory of file
      // {filename} => the file name only (without extension)
      // {extname} => the file extension name only
      "**/*.{js,css}:public/build/{filepath/1/_entries}/{filename}.{extname}",
      "**/*.html:views/build/{filepath/1/_templates}/{filename}.{extname}"
    ],
    "bundleOptions": {
      // by default tarima processes file extensions from right to left, so foo.es6.js will compile to
      // foo.js, which is the explicit way of doing this; extensions are a shortcut to make this setup
      // implicit and discreet
      "extensions": {
        "js": "es6", // foo.js => foo.es6.js
        "css": "post" // foo.css => foo.post.css
      },
      // see rollup.js
      "rollup": {
        "format": "iife"
      },
      // see postcss
      "postcss": {
        "plugins": [
          "postcss-import",
          "postcss-cssnext"
        ]
      }
    }
  },
  // have fun ;)
  "devDependencies": {
    "buble": "0.11.6",
    "rollup": "0.32.0",
    "tarima-browser-sync": "0.1.3",
    "tarima-cli": "0.1.8"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment