New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-preset-browser-esm

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-browser-esm

Babel preset to convert and load ESM in the browser

  • 1.0.0-rc
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Babel Preset: Browser ESM

Build Status

A Babel 7 compatible preset to fully support loading modules as ESM in the browser natively. This preset will:

  • Automatically inline environment variables
  • Runs dead code elimination
  • Transforms CommonJS to ESM
  • Converts global imports to relative paths using require.resolve
  • Adds missing .js extension

Usage

npm install --save-dev babel-preset-browser-esm

Update your babel configuration, ensure you use babel.config.js over .babelrc to ensure node_modules get properly updated:

module.exports = {
  presets: ['browser-esm']
};

Run server

This module pairs very nicely with bserve to run a static server and automatically transpile the JavaScript files.

Keywords

FAQs

Package last updated on 07 Nov 2018

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