preroll
An opinionated web project builder with dev server
Last updated 2 years ago by lukejacksonn .
ISC · Original npm · Tarball · package.json
$ cnpm install preroll 
SYNC missed versions from official npm registry.

Preroll

An opinionated web project builder with dev server

This is a collection of simple rollup-plugins that make developing ready to deploy, static web apps simple.

When ran, it builds files for production by default; all scripts get bundled, treeshaken, transpiled from ES6 (including JSX) to ES5 and then minified. Any styles imported in your code get included in the bundle and injected into the head on page load.

If you call preroll(true) then it will build the project and enter development mode; it watches project files, serves the contents of static on localhost:8080 and live reloads the app in the browser when project files change.

Includes

Install as a dev dependency

npm i preroll -D

Add preroll to rollup.config

import preroll from 'preroll'

// If rollup was called with the watch flag
const dev = !!process.env.ROLLUP_WATCH

export default {
  input: 'src/index.js',
  output: {
    file: 'static/index.js',
    sourcemap: dev ? 'inline' : false,
    format: 'iife',
  },
  plugins: [
    ...preroll(dev),
    // Add other rollup plugins here...
  ]
}

Invoke rollup from package.json

scripts: {
  build: 'rollup -c',   // <- Production build
  start: 'rollup -c -w' // <- Development mode
}

Current Tags

  • 0.2.1                                ...           latest (2 years ago)

5 Versions

  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 5
This Week 5
This Month 7
Last Day 0
Last Week 0
Last Month 1
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |