All Projects → rajasegar → unpack

rajasegar / unpack

Licence: MIT license
Create Web apps without a bundler

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to unpack

nanobundle
Yet another build tool for libraries, powered by esbuild
Stars: ✭ 45 (+15.38%)
Mutual labels:  bundler, esmodules, esm
oletus
Minimal ECMAScript Module test runner
Stars: ✭ 43 (+10.26%)
Mutual labels:  esmodules, esm
npm-es-modules
Breakdown of 7 different ways to use ES modules with npm today.
Stars: ✭ 67 (+71.79%)
Mutual labels:  esmodules, esm
tape-es
ESM-compatible Tape.js test runner
Stars: ✭ 24 (-38.46%)
Mutual labels:  esmodules, esm
absurdum
The Ridiculous Application of Reduce
Stars: ✭ 61 (+56.41%)
Mutual labels:  esmodules, esm
Jsdelivr
A free, fast, and reliable Open Source CDN for npm, GitHub, Javascript, and ESM
Stars: ✭ 4,052 (+10289.74%)
Mutual labels:  esmodules, esm
Esm
Tomorrow's ECMAScript modules today!
Stars: ✭ 5,093 (+12958.97%)
Mutual labels:  esmodules, esm
babel-plugin-rewire-exports
Babel plugin for stubbing [ES6, ES2015] module exports
Stars: ✭ 62 (+58.97%)
Mutual labels:  esm
fliphub
the easiest app builder
Stars: ✭ 30 (-23.08%)
Mutual labels:  bundler
urlpack
Pure JavaScript toolkit for data URLs (MessagePack, Base58 and Base62)
Stars: ✭ 51 (+30.77%)
Mutual labels:  esmodules
TML.Patcher
Console application for decompiling, recompiling, packaging, and patching tModLoader's .tmod files at blazing-fast speeds.
Stars: ✭ 38 (-2.56%)
Mutual labels:  unpack
adonis-bundler
Blazing fast, zero configuration assets bundler for AdonisJS
Stars: ✭ 19 (-51.28%)
Mutual labels:  bundler
motion-hooks
A simple Hooks wrapper over Motion One, An animation library, built on the Web Animations API for the smallest filesize and the fastest performance.
Stars: ✭ 93 (+138.46%)
Mutual labels:  esm
awesome-esbuild
A curated list of awesome esbuild resources
Stars: ✭ 195 (+400%)
Mutual labels:  bundler
coverage-node
A simple CLI to run Node.js and report code coverage.
Stars: ✭ 39 (+0%)
Mutual labels:  esm
wparcel
A webpack-based parcel-like web application bundler
Stars: ✭ 45 (+15.38%)
Mutual labels:  bundler
dmc unrar
A dependency-free, single-file FLOSS unrar library
Stars: ✭ 47 (+20.51%)
Mutual labels:  unpack
minipack-kr
📦 자바스크립트 모듈 번들러를 만드는 간단한 예제입니다.
Stars: ✭ 105 (+169.23%)
Mutual labels:  bundler
tailwind-layouts
Collection of Tailwind Layouts
Stars: ✭ 53 (+35.9%)
Mutual labels:  esm
ws
scripts for building web projects
Stars: ✭ 13 (-66.67%)
Mutual labels:  bundler

unpack

Build and Deploy npm version semantic-release Conventional Commits

🚀 Create web apps without a bundler 📦.

unpack is a web app scaffolding tool which generates a project boilerplate with no npm dependencies, to develop and build apps within the browser without any build tooling.

WARNING: Not recommended for production workflows.

Installation

npx @rajasegar/unpack

Using npm

npm i -g @rajasegar/unpack

Using yarn

yarn add --global @rajasegar/unpack

Using pnpm

pnpm add --global @rajasegar/unpack

Usage

unpack

Follow the prompts to choose the Framework (React, Preact or Vue) and CDN (Skypack, jspm or unpkg).

Then switch to the newly created app directory and start a web server, something like http-server or servor. You are free to choose your own web-server tool, there is no lock-in unlike other bundlers.

cd my-react-app
servor . --reload --browse

You can also choose from predefined templates for a particular framework using:

unpack new <project-name> --template React --cdn skypack

or

unpack new my-preact-app -t Preact --cdn skypack

The --template option can have the following values:

  • React
  • Preact
  • Vue
  • Vue3
  • lit-element
  • hyperapp
  • RxJS
  • Cycle

The --cdn option can have the following values:

  • jspm
  • skypack
  • unpkg
  • esm
  • jsdelivr
  • esm.run

index.html (generated)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>hello</title>
</head>
<body>
  <div id="app"></app>
  <script type="module" src="https://jspm.dev/es-module-shims"></script>
  <script type="importmap-shim">
  {
    "imports": {
      "react": "https://cdn.skypack.dev/react?min",
      "react-dom": "https://cdn.skypack.dev/react-dom?min",
      "htm": "https://cdn.skypack.dev/htm?min"
    }
  }
  </script>
  <script type="module-shim">
    import React from "react";
    import ReactDOM from "react-dom";
    import htm from "htm";

    const html = htm.bind(React.createElement);
    const App = () => html`<h1>Hello React from skypack</h1>`;

    ReactDOM.render(html`<${App}/>`, document.getElementById('app'));
  </script>
</body>
</html>

How does it work?

It makes use of CDN for delivering ESM compatible JS to the browser for your favorite JS libraries and frameworks so that you can make use of the module scripts to run code inside your browser. It also makes use of import maps to enhance the developer experience to map the absolute package urls to user-friendly names so that you don't have to write import statements like:

import React from  'https://unpkg.com/react@17/umd/react.production.min.js';

Instead you can simply use:

import React from 'react';

Import maps are not yet mainstream, since not all the browsers implemented them and Chrome supports it behind a feature flag. That's why unpack includes the es-module-shims script to work with import maps.

Support Matrix

Framework/CDN Skypack jspm unpkg esm.sh jsdelivr esm.run
React ✔️ ✔️ ✔️ ✔️ ✔️
Preact ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Vue ✔️
Vue 3 ✔️ ✔️
lit-element ✔️ ✔️ ✔️ ✔️ ✔️
hyperapp ✔️ ✔️ ✔️ ✔️ ✔️
Cycle.js ✔️ ✔️
RxJS ✔️ ✔️ ✔️ ✔️

Edited the above Markdown table with tablesgenerator.com

CDN Support

Framework Support

Bundling for production

Work in progress...

Known issues

  • Vue template works only with jspm
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].