All Projects → chenglou → require-polyfill

chenglou / require-polyfill

Licence: other
Make `require` work in browsers, at runtime. No code bundling needed!

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to require-polyfill

String.prototype.trim
ES5 spec-compliant shim for String.prototype.trim
Stars: ✭ 13 (-64.86%)
Mutual labels:  polyfill
Promise.allSettled
ES Proposal spec-compliant shim for Promise.allSettled
Stars: ✭ 93 (+151.35%)
Mutual labels:  polyfill
weakmap-polyfill
ECMAScript6 WeakMap polyfill
Stars: ✭ 25 (-32.43%)
Mutual labels:  polyfill
module-invalidate
Invalidate node.js modules loaded through require()
Stars: ✭ 19 (-48.65%)
Mutual labels:  require
css grid annotator
Automatically annotate CSS Grid items with row and column positions, so they are correctly positioned in IE11.
Stars: ✭ 59 (+59.46%)
Mutual labels:  polyfill
WDS-Required-Plugins
Make certain plugins required so that they cannot be (easily) deactivated. | Gatekeeper: @aubreypwd
Stars: ✭ 77 (+108.11%)
Mutual labels:  require
seamless-scroll-polyfill
Scroll Behavior polyfill
Stars: ✭ 134 (+262.16%)
Mutual labels:  polyfill
Javascript-Interview-Preparation
A curated collection of javascript interview questions & solutions.
Stars: ✭ 163 (+340.54%)
Mutual labels:  polyfill
Object.getOwnPropertyDescriptors
Spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.
Stars: ✭ 19 (-48.65%)
Mutual labels:  polyfill
polyfill-php81
This component provides functions unavailable in releases prior to PHP 8.1.
Stars: ✭ 618 (+1570.27%)
Mutual labels:  polyfill
deno-fetch-event-adapter
Dispatches global fetch events using Deno's native http server.
Stars: ✭ 18 (-51.35%)
Mutual labels:  polyfill
react-native-drawer-layout-polyfill
A polyfill for React Natives DrawerLayoutAndroid
Stars: ✭ 48 (+29.73%)
Mutual labels:  polyfill
fetch
A fetch API polyfill for React Native with text streaming support.
Stars: ✭ 27 (-27.03%)
Mutual labels:  polyfill
ember-on-modifier
Implements the `{{on eventName this.someAction}}` element modifier from https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md
Stars: ✭ 37 (+0%)
Mutual labels:  polyfill
symfony-tools
Collection of polyfill (backport) and incubator features for Symfony 3
Stars: ✭ 19 (-48.65%)
Mutual labels:  polyfill
sanitizer-polyfill
rewrite constructor arguments, call DOMPurify, profit
Stars: ✭ 46 (+24.32%)
Mutual labels:  polyfill
parcel-plugin-goodie-bag
provides the Promise and fetch goodies needed for IE(11) support w/ parcel bundle loading
Stars: ✭ 15 (-59.46%)
Mutual labels:  polyfill
konan
find all require/import calls by walking the AST
Stars: ✭ 48 (+29.73%)
Mutual labels:  require
Polyfill
An artifact repository to assist writing Gradle Plugins for Android build system.
Stars: ✭ 68 (+83.78%)
Mutual labels:  polyfill
iframe-worker
A tiny WebWorker polyfill for the file:// protocol
Stars: ✭ 23 (-37.84%)
Mutual labels:  polyfill

Require Polyfill

This simple script is inspired by require1k, with a few flaws fixed (works with npm3, reads package.json's main field, etc.).

Usage

Drop it into a script tag like so:

<script src="./path/to/require_polyfill.js" data-main="./path/to/entry/file" data-project-root="./"></script>

Where data-project-root is where node_modules is located.

Tada! All your js files' require statements will work! No watcher, no code bundling, no hassle.

Note: This is only meant to be used as a development time convenience.

Note2: On browsers like Chrome that disallow cross origin requests, we can't load directly from the file system. Start a local server in that case. Alternatively, try Safari or Firefox!

Known Issues

  • Doesn't polyfill the node.js libraries. So e.g. require('fs') would fail.

  • Doesn't support code splitting. Kidding, it supports all the code splitting.

  • Doesn't have a logo (TODO: create an entire community around this script).

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].