@langri-sha/babel-test
v0.6.5
Published
Provides convenience helpers for inspecting and testing your [Babel] preset.
Downloads
26
Readme
@langri-sha/babel-test
Provides convenience helpers for inspecting and testing your Babel preset.
Features
- load Babel presets with options, and produce a serializable, cross-platform output of all the loaded plugins and their settings
Usage
Install related dependencies:
npm install -D @babel/core @langri-sha/babel-test
Then load the preset plugins:
// Load preset plugins.
await loadPresetPlugins(
// Set Babel API environment.
'development',
[
// Preset to load.
'@babel/preset-env',
// Configure related preset options.
{ test: 'TEST_OPTIONS' },
]
)
/*
[
[
"<WORKSPACE>/node_modules/@babel/preset-env/index.js",
{
"foobar": "quuxnorf",
},
],
]