@react-native-esbuild/dev-server
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-alpha.43 • Public • Published

@react-native-esbuild/dev-server

Development server for @react-native-esbuild

Usage

import {
  ReactNativeAppServer,
  ReactNativeWebServer,
} from '@react-native-esbuild/dev-server';

const serveOptions = {
  port: '8081',
  host: 'localhost',
};

// For Native (Android, iOS)
const server = await new ReactNativeAppServer(
  serveOptions,
).initialize((bundler) => {
  bundler
    .registerPlugin(/* plugin */)
    .registerPlugin(/* plugin */)
    .registerPlugin(/* plugin */);
});

// For Web
const server = await new ReactNativeWebServer(
  serveOptions,
  bundleOptions,
).initialize((bundler) => {
  bundler
    .registerPlugin(createSvgTransformPlugin())
    .registerPlugin(createReactNativeRuntimeTransformPlugin())
    .registerPlugin(createReactNativeWebPlugin());
});

server.listen(() => console.log('listening!'));

Readme

Keywords

Package Sidebar

Install

npm i @react-native-esbuild/dev-server

Weekly Downloads

8

Version

0.1.0-alpha.43

License

MIT

Unpacked Size

85.6 kB

Total Files

45

Last publish

Collaborators

  • ghlee