Babel-plugin-amd-checker - Module format checking plugin for Babel usable in both Node.js the web browser environments.

Overview

babel-plugin-amd-checker

Latest version Dependency status

A Babel plugin to check the format of your modules when compiling your code using Babel. This plugin allows you to abort the module transformation, if the module source complies with AMD and let the transformation apply only on ESM modules. transform the path of each source module using a custom JavaScript function.

This plugin is supposed to be used with requirejs-babel7, where the target environment is a web browser using @babel/standalone. If if detects an AMD module, it will throw an error of the class AmdDetected and abort the module transformation. The error can be caught and ignored in the build pipeline.

Table of Contents

Installation

This module can be installed in your project using NPM, PNPM or Yarn. Make sure, that you use Node.js version 6 or newer.

npm i -D babel-plugin-amd-checker
pnpm i -D babel-plugin-amd-checker
yarn add babel-plugin-amd-checker

Babel Configuration Examples

Prepend path to utility modules to be able to import them from utils/... without always providing the actual full path:

{
  plugins: ['amd-checker']
}

A typical configuration combined with babel-plugin-module-resolver-standalone and set within requirejs-babel7 by default:

{
  plugins: [
    'amd-checker',
    'transform-modules-amd',
    [
      'module-resolver',
      {
        resolvePath: function (sourcePath, currentFile, opts) {
          // Avoid prefixing modules handled by other plugins.
          if (sourcePath.indexOf('!') < 0) {
            return 'es6!' + sourcePath;
          }
        }
      }
    ]
  ]
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code.

License

Copyright (c) 2022 Ferdinand Prantl

Licensed under the MIT license.

You might also like...

A simple static type checker that enforces C-style programming in Julia

SimpleTypeChecker is an experimental Julia package designed to enforce C-style programming in Julia language. Note : it won't save you if your codes a

May 23, 2023

ToDo list app is a simple web app that helps you organize your day, by adding, checking and deleting daily tasks

ToDo list app is a simple web app that helps you organize your day, by adding, checking and deleting daily tasks

TODO List App "To-do list" is a WebApp tool that helps to organize your day. It simply lists the tasks that you need to do and allows you to mark them

Oct 18, 2022

Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js.

Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js.

Pintora Documentation | Live Editor Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js. Expressing yo

Dec 30, 2022

Framework for interacting with instagrams private api in a usable manner (forked from andre's work and improved and fixed)

node-ig-framework Framework for interacting with instagrams private api in a usable manner (forked from andre's work and improved and fixed) Installat

Dec 31, 2022

Omnichannel Live Chat Widget UI Components offers a re-usable component-based library to help create a custom chat widget that can be connected to the Dynamics 365 Customer Service experience.

Omnichannel Live Chat Widget UI Components @microsoft/omnichannel-chat-widget is a React-based UI component library which allows you to build your own

Dec 15, 2022

This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usable in Tumult Hype 4 based on your Photoshop document.

This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usable in Tumult Hype 4 based on your Photoshop document.

Export To Hype (Photoshop Edition) This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usab

Nov 9, 2022

Type predicate functions for checking if a value is of a specific type or asserting that it is.

As-Is Description As-Is contains two modules. Is - Type predicates for checking values are of certain types. As - Asserting values are of a certain ty

Feb 10, 2022

A type speed checking website which lets you check your typing speed and shows the real-tme leaderboards with mongodb as DB and express as backend

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Mar 27, 2022

Simple, lightweight at-runtime type checking functions, with full TypeScript support

pheno Simple, lightweight at-runtime type checking functions, with full TypeScript support Features Full TypeScript integration: TypeScript understand

Sep 5, 2022
Releases(v0.0.2)
Owner
Ferdinand Prantl
Ferdinand Prantl
Babel plugin and helper functions for interoperation between Node.js native ESM and Babel ESM

babel-plugin-node-cjs-interop and node-cjs-interop: fix the default import interoperability issue in Node.js The problem to solve Consider the followi

Masaki Hara 15 Nov 6, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
🔥 A Powerful JavaScript Module for Generating and Checking Discord Nitro 🌹

DANG: Dreamy's Awesome Nitro Generator Join Our Discord Getting Started Before, We start please follow these Steps: Required* ⭐ Give a Star to this dr

Dreamy Developer 73 Jan 5, 2023
End-to-end encrypted environments

Welcome to the EnvKey v2 monorepo! All EnvKey's open source code lives here. End-to-end encrypted environments Fixes configuration sprawl and sloppy s

EnvKey 360 Jan 1, 2023
Test utility to mock `window.matchMedia` for JSDOM environments.

mock-match-media Test utility for mocking window.matchMedia in JSDOM environments. JSDOM doesn't provide support for window.matchMedia, which means te

Raymond Wang 2 Oct 12, 2022
EA Origin platform username checker

Origin EA Origin platform username checker. Instructions [?] Installation "npm i" [?] Fill in your Discord webhook details. "var webhookId = ``;" "va

yani 3 Sep 29, 2022
NodeJs, tron transaction checker

Tron node-Explorer Recommended requirements Node v14.17.5. npm 6.14.14 https://nodejs.org Development Install dependencies npm install Running applica

null 3 Aug 21, 2022
this is a discord nitro generator and checker⚙ EZPZ

Language | EN Hello my dear friends ???? In this new project, I wrote a program to extract nitro discord code, which after extracting the code, verifi

Sobhan.SRZA 6 Sep 17, 2022