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

@videojs/babel-config

Package Overview
Dependencies
Maintainers
18
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@videojs/babel-config

A standard babel config, so that plugins don't need the same script in every repository.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
515
increased by39.57%
Maintainers
18
Weekly downloads
 
Created
Source

@videojs/babel-config

Build Status Greenkeeper badge Slack Status

Currently babel configs are the same for most plugins, and most of them are built using this babel config via babel. We have some libraries though that are should not be built using rollup for nodejs consumption, that are currently doing so. So this config while still consumed by videojs-generate-rollup-config can also be used standalone with babel-cli.

Lead Maintainer: Brandon Casey @brandonocasey

Maintenance Status: Stable

Table of Contents

Installation

$ npm install --save-dev @babel/cli @videojs/babel-config

Usage

  1. In your rollup config add a line to delete module builds:
if (config.builds.module) {
	delete config.builds.module;
}
  1. Add a npm scripts for cjs/es dists to your package.json:
{
  "build:cjs": "babel-config-cjs -d ./dist/cjs ./src",
  "build:es": "babel-config-es -d ./dist/cjs ./src",
  "watch:cjs": "npm run build:cjs -- -w",
  "watch:es": "npm run build:es -- -w"
}
  1. verify that main in package.json is set to the cjs dist. Something like dist/cjs/index.js
  2. verify that module in package.json is set to the es dist. Something like dist/es/index.js
  3. verify that browser in package.json is set to the browser dist. Something like dist/project-name.js

Important things

  • When running through babel-config-cjs, babel-config-es, or babel-config-run if TEST_BUNDLE_ONLY is set nothing will run!
  • The babel-config-cjs binary runs babel cli with --verbose and --config-file set to the cjs config exported here.
  • The babel-config-es binary runs babel cli with --verbose and --config-file set to the es config exported here.
  • The babel-config-run binary runs babel cli with --verbose but no config file.

Changing configuration

  1. require the configuration you want to use const config = require('@videojs/babel-config/cjs.js');
  2. Make changes to it and export: module.export = config.
  3. pass --config-file <path> in the above scripts so that everything points to your new configs.
  4. change the above script to use babel-config-run

FAQs

Package last updated on 30 Sep 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