This plugin is a transform to remove unused nanoutils dependencies, without forcing the user to cherry pick methods manually.
Works the same as babel-plugin-ramda
Converts
import N, { map } from 'nanoutils'
map(N.add(1), [1, 2, 3])
To
import add from 'nanoutils/es/add'
import map from 'nanoutils/es/map'
npm install babel-plugin-nanoutils
{
"plugins": ["nanoutils"]
}
babel --plugins nanoutils script.js
require("babel-core").transform("code", {
plugins: ["nanoutils"]
});
Instead of es
folder, it will use cjs
folder with require
instead of import