Skip to content

Commit

Permalink
do not use default export
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Apr 5, 2024
1 parent 862b71e commit 0a64673
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/babel/plugin-debug-label.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import { basename, dirname, extname } from 'path'
import babel, { PluginObj } from '@babel/core'
import _templateBuilder from '@babel/template'
import { isAtom } from './utils.ts'
Expand All @@ -20,11 +20,11 @@ export default function debugLabelPlugin(
) {
const filename = state.filename || 'unknown'

let displayName = path.basename(filename, path.extname(filename))
let displayName = basename(filename, extname(filename))

// ./{module name}/index.js
if (displayName === 'index') {
displayName = path.basename(path.dirname(filename))
displayName = basename(dirname(filename))
}
// Relies on visiting the variable declaration to add the debugLabel
const buildExport = templateBuilder(`
Expand Down

0 comments on commit 0a64673

Please sign in to comment.