Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rebox/web

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rebox/web

Set of helpers to deal with React applications using our Babel config

  • 2.1.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
75K
increased by9.92%
Maintainers
4
Weekly downloads
 
Created
Source

@rebox/web npm

Set of helpers to deal with React applications using our Babel config.

Install

$ yarn add @rebox/web

API

type TBuildWebAppReleaseOptions = {
  entryPointPath: string,
  htmlTemplatePath: string,
  outputPath: string,
  browsersList?: string[], // ['defaults'] by default
  globalConstants?: {
    [key: string]: string
  },
  globalAliases?: {
    [key: string]: string
  },
  isQuiet?: boolean, // false by default
  shouldGenerateSourceMaps?: boolean, // false by default
  shouldGenerateBundleAnalyzerReport?: boolean // false by default
}

const buildWebAppRelease: (userOptions: TBuildWebAppReleaseOptions) => Promise<void>
type TRunWebAppOptions = {
  entryPointPath: string,
  htmlTemplatePath: string,
  browsersList?: string[], // ['last 1 Chrome version', 'last 1 Firefox version'] by default
  assetsPath?: string,
  isQuiet?: boolean, // false by default
  shouldOpenBrowser?: boolean // false by default
}

const runWebApp: (options: TRunWebAppOptions) => Promise<() => Promise<void>>

Usage

// App.tsx
import React, { FC } from 'react'

export const App: FC<{}> = () => (
  <h1>Test</h1>
)
<!-- template.html -->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title>Test</title>
    <style>
      body { margin: 0 }
    </style>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
// build.ts
import { buildWebAppRelease } from '@rebox/web'

await buildWebAppRelease({
  entryPointPath: './App.tsx',
  htmlTemplatePath: './template.html',
  outputPath: './build/',
})
// run.ts
import { runWebApp } from '@rebox/web'

await runWebApp({
  entryPointPath: './App.tsx',
  htmlTemplatePath: './template.html'
})

Keywords

FAQs

Package last updated on 09 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc