JSPM

  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q82889F
  • License MIT

A delicious hand roll of Rollup plugins.

Package Exports

  • handroll

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (handroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

handroll NPM version Build Status Coverage Status Dependency Status Gitter chat

An expertly rolled JavaScript app.

Today many of our apps are JavaScript-only, with both HTML and CSS generated at runtime. Handroll bundles your app from a single entry file, importing CSS, HTML and JavaScript along the way and generating the necessarily opinionated scaffolding for you.

You're welcome.

Motivating example

autoTransform = require 'rollup-plugin-auto-transform'
builtins      = require 'rollup-plugin-node-builtins'
coffee        = require 'rollup-plugin-coffee-script'
commonjs      = require 'rollup-plugin-commonjs'
filesize      = require 'rollup-plugin-filesize'
globals       = require 'rollup-plugin-node-globals'
json          = require 'rollup-plugin-json'
nodeResolve   = require 'rollup-plugin-node-resolve'
pug           = require 'rollup-plugin-pug'
rollup        = require 'rollup'
stylup        = require 'rollup-plugin-stylup'

postcss      = require 'poststylus'
autoprefixer = require 'autoprefixer'
comments     = require 'postcss-discard-comments'
lost         = require 'lost-stylus'

pkg         = require './package.json'

plugins = [
  autoTransform()
  globals()
  builtins()
  coffee()
  pug
    pretty:                 true
    compileDebug:           true
    sourceMap:              false
    inlineRuntimeFunctions: false
    staticPattern:          /\S/
  stylup
    sourceMap: false
    plugins: [
      lost()
      postcss [
        autoprefixer browsers: '> 1%'
        'lost'
        'css-mqpacker'
        comments removeAll: true
      ]
    ]
  json()
  nodeResolve
    browser: true
    extensions: ['.js', '.coffee', '.pug', '.styl']
    module: true
    jsnext: true
  commonjs
    extensions: ['.js', '.coffee']
    sourceMap: false
  filesize()
]

bundle = yield rollup.rollup
  entry:    'src/app.coffee'
  plugins:  plugins

# App bundle for browser
bundle.write
  dest:      'public/js/app.js'
  format:    'iife'

..and that's with all the necessary scaffolding omitted.

Install

$ npm install handroll --save-dev

Usage

handroll = require 'handroll'

app = await handroll.bundle
  entry: src/index.coffee

app.write
  dest: 'public'