All Projects → MrLoh → Metro With Symlinks

MrLoh / Metro With Symlinks

Metro with Symlinks

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Metro With Symlinks

monopack
A JavaScript bundler for node.js monorepo-codebased applications.
Stars: ✭ 52 (+6.12%)
Mutual labels:  bundler
Pundle
👾 peaceful bundles - js bundler, built from the ground up for speed and extensibility
Stars: ✭ 354 (+622.45%)
Mutual labels:  bundler
Packem
📦⚡ A precompiled JavaScript module bundler
Stars: ✭ 586 (+1095.92%)
Mutual labels:  bundler
Webpack-4-boilerplate
🚀 Webpack 4 with ES6+ and SASS,LESS/STYLUS support + dev-server and livereload
Stars: ✭ 55 (+12.24%)
Mutual labels:  bundler
Svelvet
🧵 An experimental svelte compiler & watcher that works with snowpack
Stars: ✭ 310 (+532.65%)
Mutual labels:  bundler
Mam mol
$mol - fastest reactive micro-modular compact flexible lazy ui web framework.
Stars: ✭ 385 (+685.71%)
Mutual labels:  bundler
website
Documentation for the SWC project.
Stars: ✭ 53 (+8.16%)
Mutual labels:  bundler
Scarab
A system to patch your content files.
Stars: ✭ 38 (-22.45%)
Mutual labels:  bundler
Wp Webpack Script
💥🔥📦👩‍💻 An easy to use, pre configured, hackable webpack setup & development server for WordPress themes and plugins.
Stars: ✭ 314 (+540.82%)
Mutual labels:  bundler
Sheetify
✨ Modular CSS bundler for browserify
Stars: ✭ 443 (+804.08%)
Mutual labels:  bundler
circleci-ruby-orbs
CircleCI orb for ruby
Stars: ✭ 16 (-67.35%)
Mutual labels:  bundler
Notebook As Pdf
Save Jupyter Notebooks as PDF
Stars: ✭ 290 (+491.84%)
Mutual labels:  bundler
Metro
🚇 The JavaScript bundler for React Native.
Stars: ✭ 4,308 (+8691.84%)
Mutual labels:  bundler
rolldown
Modern bundler built on Rollup with couple more features, such as multiple entry points, presets, better configuration experience and more.
Stars: ✭ 17 (-65.31%)
Mutual labels:  bundler
Parcel Plugin Structurize
A plugin to customize the output (dist) directory structure during production.
Stars: ✭ 29 (-40.82%)
Mutual labels:  bundler
ng2-fused
FuseBox plugins and utilities for building Angular2 applications.
Stars: ✭ 13 (-73.47%)
Mutual labels:  bundler
Trunk
Build, bundle & ship your Rust WASM application to the web.
Stars: ✭ 378 (+671.43%)
Mutual labels:  bundler
Phaser Node Kit
Rapid Game Development with PhaserJS and Node for Modern Browsers
Stars: ✭ 39 (-20.41%)
Mutual labels:  bundler
Bili
Bili makes it easier to bundle JavaScript libraries.
Stars: ✭ 949 (+1836.73%)
Mutual labels:  bundler
Fuse Box
A blazing fast js bundler/loader with a comprehensive API 🔥
Stars: ✭ 4,055 (+8175.51%)
Mutual labels:  bundler

metro-with-symlinks

There is a longstanding issue with Metro not accepting symlinks and thus making it hard to use in monorepo setups or example projects. This script provides a solution.

This package generates a custom rn-cli.config.js file based on checking for symlinks inside the node_modules. It also takes care of making peer dependencies available to those symlinked modules.

Usage

# Install
yarn add -D metro-with-symlinks
# or
npm install -D metro-with-symlinks

In the most recent version of the metro bundler, you just need to have a rn-cli.config file in your root folder and it will automatically be read by the bundler. You can generate that file by running metro-with-symlinks without any argument in the terminal, which will generate the rn-cli.config file. You will have to regenerate this file, whenever you symlink another package or add a peerDependency to your link

Side Effects

Since this fix consists of adding linked packages as react-native project roots, this causes react native to try and transpile the code of the package. This can be an issue if your package has its own transpilation process, leading to multiple transpilation attempts on the same code. To prevent this from happening, you'll have to ignore the linked package from inside the react native projects .babelrc. For example:

{
  ... 
  "ignore": [
    "some-linked-package"
  ]
}

Usage (Older Versions)

In older versions, you have to tell the packager where to find the config file. To do so you can simply replace the standard react-native commands with this custom command. For example: replace the start script in your package.json with this:

"scripts": {
    "start": "metro-with-symlinks start",
}

Using with Xcode (Only Older Versions)

# You will need to have run this or the start command above to generate rn-cli.config.js config.
yarn metro-with-symlinks

In Xcode you can assign an environment variable in the build phase Bundle React Native code and images. Add:

export BUNDLE_CONFIG=./rn-cli.config.js

Xcode bundle config

Using with Gradle (Only Older Versions)

In Android you just have to include bundleConfig: "./rn-cli.config.js" in the project.ext.react field of your android/app/build.gradle:

Android Studio bundle config

Contributing

If there is a specific feature you are missing, please create an issue or ideally open a pull request.

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