All Projects → chocolateboy → babel-plugin-source-map-support

chocolateboy / babel-plugin-source-map-support

Licence: Artistic-2.0 License
A Babel plugin which automatically makes stack traces source-map aware

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babel-plugin-source-map-support

react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (-53.66%)
Mutual labels:  babel, npm-package, npm-module
react-innertext
Returns the innerText of a React JSX object.
Stars: ✭ 37 (-9.76%)
Mutual labels:  babel, npm-package, npm-module
Forge Node App
🛠📦🎉 Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (+119.51%)
Mutual labels:  babel, npm-package, npm-module
ts-ci
🚀 A starter for TS projects meant to be published on NPM.
Stars: ✭ 282 (+587.8%)
Mutual labels:  npm-package, npm-module
arcscord
A Discord library written in typescript
Stars: ✭ 18 (-56.1%)
Mutual labels:  npm-package, npm-module
MinifyAllCli
📦 A lightweight, simple and easy npm tool to 𝗺𝗶𝗻𝗶𝗳𝘆 JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as 𝑪𝑳𝑰 tool or 𝒊𝒎𝒑𝒐𝒓𝒕𝒂𝒃𝒍𝒆 in TS/JS as a 𝑴𝑶𝑫𝑼𝑳𝑬 🥰
Stars: ✭ 21 (-48.78%)
Mutual labels:  npm-package, npm-module
S2s
Coding time Compile. A tool to write code fastest.
Stars: ✭ 254 (+519.51%)
Mutual labels:  babel, babel-plugin
windows-network-drive
Do network drive stuff on Microsoft Window in node
Stars: ✭ 18 (-56.1%)
Mutual labels:  npm-package, npm-module
react-folder-tree
A versatile react treeview library that supports custom icons and event handlers
Stars: ✭ 56 (+36.59%)
Mutual labels:  npm-package, npm-module
react-native-input-prompt
A cross-platform user input prompt component for React Native with Native UI.
Stars: ✭ 45 (+9.76%)
Mutual labels:  npm-package, npm-module
picsort
Organize your photos by date in one click 👏
Stars: ✭ 22 (-46.34%)
Mutual labels:  npm-package, npm-module
babel-plugin-proposal-pattern-matching
the minimal grammar, high performance JavaScript pattern matching implementation
Stars: ✭ 34 (-17.07%)
Mutual labels:  babel, babel-plugin
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-Möller
Stars: ✭ 17 (-58.54%)
Mutual labels:  npm-package, npm-module
js-stack-from-scratch
🌺 Russian translation of "JavaScript Stack from Scratch" from the React-Theming developers https://github.com/sm-react/react-theming
Stars: ✭ 394 (+860.98%)
Mutual labels:  npm-package, npm-module
micro-signals
A tiny typed messaging system inspired by js-signals that uses ES2015 sets
Stars: ✭ 39 (-4.88%)
Mutual labels:  npm-package, npm-module
get-source
Fetch source-mapped sources. Peek by file, line, column. Node & browsers. Sync & async.
Stars: ✭ 26 (-36.59%)
Mutual labels:  sourcemaps, sourcemap
React-Pincode
A NPM module which auto fills City, District and State fields when a valid Zip Code in entered!
Stars: ✭ 26 (-36.59%)
Mutual labels:  npm-package, npm-module
Eslint Import Resolver Babel Module
Custom eslint resolve for babel-plugin-module-resolver
Stars: ✭ 236 (+475.61%)
Mutual labels:  babel, babel-plugin
Xwind
Tailwind CSS as a templating language in JS and CSS-in-JS
Stars: ✭ 249 (+507.32%)
Mutual labels:  babel, babel-plugin
docker-google-lighthouse-puppeteer
Google Lighthouse + Puppeteer / Docker Image
Stars: ✭ 29 (-29.27%)
Mutual labels:  npm-package, npm-module

Build Status NPM Version

NAME

babel-plugin-source-map-support - a Babel plugin which automatically makes stack traces source-map aware

INSTALL

$ npm install source-map-support --save
$ npm install babel-plugin-source-map-support --save-dev

SYNOPSIS

$ cat test.js

import foo from 'foo';
import bar from 'bar';

foo(bar);

$ babel --plugins source-map-support test.js

import 'source-map-support/register';
import foo from 'foo';
import bar from 'bar';

foo(bar);

DESCRIPTION

This is a Babel plugin which prepends the following statement to source files:

import 'source-map-support/register';

In conjunction with the source-map-support module, which must be installed separately, this statement hooks into the v8 stack-trace API to translate call sites in the transpiled code back to their corresponding locations in the original code.

Note: this only works in environments which support the v8 stack-trace API (e.g. Node.js and Chrome), though it's harmless in other environments.

The source-map-support module only needs to be registered in the top-level file(s) of an application, but it no-ops if it has already been loaded, so there's no harm in registering it in every file.

You probably don't want to use this plugin when compiling code for the web because you probably don't want to bundle source-maps and the source-map-support module in minified code. An easy way to limit the plugin's scope to development/test builds is to use Babel's env option, e.g.:

{
    env: {
        development: {
            sourceMaps: 'inline',
            plugins: ['source-map-support', ...]
        }
    },

    presets: [ ... ]
}

Note that source-maps don't need to be inlined in each file. They can be externalised by using the { sourceMaps: true } option. This adds a link to the bottom of each file which points to its generated source-map, e.g.:

{
    env: {
        development: {
            sourceMaps: true,
            plugins: ['source-map-support', ...]
        }
    },
}
// index.js footer:
//# sourceMappingURL=index.js.map

DEVELOPMENT

NPM Scripts

The following NPM scripts are available:

  • build - compile the plugin and save it to the dist directory
  • build:doc - generate the README's TOC (table of contents)
  • clean - remove the dist directory and other build artifacts
  • rebuild - clean the build artifacts and recompile the code
  • test - rebuild the plugin and run the test suite
  • test:debug - run the test script in debug mode, which dumps each transformed test case
  • test:prod - run the test suite in production mode
  • test:run - run the test suite

COMPATIBILITY

SEE ALSO

VERSION

2.1.3

AUTHOR

chocolateboy

COPYRIGHT AND LICENSE

Copyright © 2015-2020 by chocolateboy.

This module is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].