Update
This commit is contained in:
10
esbuild.ts
10
esbuild.ts
@ -12,7 +12,6 @@ import type { types as t } from '@babel/core';
|
||||
import { dependencies } from './dist/package.json';
|
||||
import { createMacro, type MacroHandler } from 'babel-plugin-macros';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const ENV = process.env.NODE_ENV || 'development';
|
||||
const PROD = ENV === 'production';
|
||||
|
||||
@ -81,6 +80,15 @@ const map = new HandlerMap()
|
||||
.set(
|
||||
'string.prototype.matchall',
|
||||
proto(t => t.identifier('matchAll')),
|
||||
)
|
||||
.set(
|
||||
'object.groupby',
|
||||
replace(t =>
|
||||
t.memberExpression(
|
||||
t.callExpression(t.identifier('require'), [t.stringLiteral('lodash')]),
|
||||
t.identifier('groupBy'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
function replace(getReplacement: (types: typeof t) => t.Expression): MacroHandler {
|
||||
|
Reference in New Issue
Block a user