• Stars
    star
    176
  • Rank 216,987 (Top 5 %)
  • Language
    TypeScript
  • Created over 6 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Zero setup rollup based bundler

Zero setup rollup

Zero configuration web application or library bundler, built on top of rollup (But some packages can be used without rollup).

Main idea of zerollup - generate deploy-ready configurations and templates for all host targets and environments at once.

  • Out of the box support for ts and file assets in application and libraries
  • Gather assets from all application dependencies
  • Allow to configure base assets url in runtime
  • No plugins to install. Automatically modules using rollup and typescript
  • Lerna friendly. Bundle or dev all packages or pick one of them
  • Builds configured bundles per each configuration
  • Asynchronously prerenders templates from ts-modules per each configuration

Packages

Zerollup is the set of packages. All of them used in preset-ts.

Setup

npm install --dev @zerollup/rollup-preset-ts

package.json:

{
  "name": "zerollup-demo",
  "scripts": {
    "build": "rollup -c node:@zerollup/rollup-preset-ts",
    "dev": "rollup -w -c node:@zerollup/rollup-preset-ts"
  }
}

Build all packages:

npm run build

Build only lib1, lib2 packages in lerna packages directory:

BULD_PKG=lib1,lib2 npm run build

Build site with assets and templates. And run development server on 10001 port.

BULD_PKG=site1 npm run dev

For examples see zerollup demo.

Why not parcel?

Look at the demo site1 dist/hosts. From one input source generated a lot of configurations and templates.

src/index.ts

import './bootstrap'
import config from './config'

export default function app(node) {
    console.log(node, config, faceAngel)
}

src/config/index.ts

/** ZEROLLUP_CONFIG_BASE_URL: / **/

// Will be replaced to defined above url
const configBaseUrl = 'ZEROLLUP_CONFIG_BASE_URL'

const config: Config = {
    some: 'index',
    configBaseUrl
}

export default config

src/config/host1.ts inherits default config and redefine ZEROLLUP_CONFIG_BASE_URL.

// ZEROLLUP_CONFIG_BASE_URL = https://my-host1-static.com/statics/PKG_NAME/PKG_VERSION/
import baseConfig, {Config} from '.'

export default Object.assign({}, baseConfig, <Config> {
    some: 'host1'
})

dist/hosts/host1/index.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Zerollup site1</title>
    </head>
    <body>
        <div id="app"></div>
        <script src="https://my-host1-static.com/statics/zerollup_demo_site1/1.0.1/config.host1.js"></script>
        <script src="https://my-host1-static.com/statics/zerollup_demo_site1/1.0.1/index.js"></script>
        <script>zerollupDemoSite1(document.getElementById('app'))</script>
    </body>
</html>

More Repositories

1

reactive-di

Extensible hierarchical dependency injection container with flowtype interface support
JavaScript
38
star
2

MillwrightMenuBundle

Menu based on KnpMenuBundle, supports config, acl, translations and routes
PHP
23
star
3

immutable-di

Simple dependency injection container with some state handling functions (for facebook flux-like state-management)
JavaScript
12
star
4

babel-plugin-transform-metadata

Reflection metadata support for classes and functions with flowtype type aliases support
JavaScript
10
star
5

phpuml

Unofficial version of PHP_UML to be handled with Composer
PHP
9
star
6

Semaphore

This library provides an api for semaphore acquire and release
PHP
9
star
7

modern-diff

Compare two data structures and produce patches in many formats
JavaScript
8
star
8

fetch-builder

RequestOptions builder for whatwg-fetch
JavaScript
6
star
9

node-config-loader

Scan directories and loads config json and yaml files
JavaScript
5
star
10

MillwrightTwitterBootstrapBundle

Twitter boostrap css widgets toolkit integration for symfony2
PHP
5
star
11

lom_atom

Alternative implementation of eigenmethod mol_atom state management library
JavaScript
4
star
12

babel-plugin-transform-pattern-matching

Generate switch/case structure from class method type annotation
JavaScript
3
star
13

reveal-multi

Generate static site with index page from reveal.js slides from multiple directories
JavaScript
3
star
14

atmover

Atom overlay: abstraction layer on top of mobx, cellx, derivable with hot reload support
JavaScript
3
star
15

hyper-config

JSON config wrapper with merge, references, string macroces and tagging
JavaScript
2
star
16

1c-importer

Framework for importing CommerceML xml files from 1c to database
PHP
2
star
17

mobx-psy

Mobx pseudo-synchronous loader
TypeScript
2
star
18

opti-update

Framework-agnostic, low-cost optimistic updates with transactions and rollbacks.
JavaScript
2
star
19

SemaphoreBundle

This bundle integrates semaphore library into symfony
PHP
2
star
20

immutable-di-history

Rollback, apply patches to immutable-di state
JavaScript
2
star
21

circular-serializer

Safe serialize and deserialize json objects, Date support, extensible custom types
JavaScript
2
star
22

micro-di

Config-based dependency injection container for node.js, inspired by Symfony2 and Spring
JavaScript
2
star
23

pdodumper

PHP PDO SQL dumper, uploader, downloader and synchronizer
PHP
2
star
24

remol

TypeScript
1
star
25

phing-migrator

Phing based database migrator
1
star
26

zerollup-demo

Zerollup demo lerna repository
TypeScript
1
star
27

urc

Universal react connect decorator builder
TypeScript
1
star
28

observable-helpers

zen-observable helpers
JavaScript
1
star
29

MillwrightBoilerplateBundle

Basic symfony2 html twig helpers for theme building
PHP
1
star
30

seabattle

Demo sea battle game written on javascript.
JavaScript
1
star
31

define-exceptions

Exceptions define library
JavaScript
1
star
32

ts-plugin-autoimport-fix

Typescript tsserver autoimport fix plugin
TypeScript
1
star
33

immutable-di-starter-kit

Babel + immutable-di starter kit
JavaScript
1
star
34

utb

Unified todomvc benchmark for react, preact, inferno without and with mobx, reactive-di state management libraries.
JavaScript
1
star