Skip to content

Commit

Permalink
Refactor to use @imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 2, 2024
1 parent e8d0874 commit f3674b9
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
/**
* @import {PluginObj, PluginPass, NodePath, default as Babel} from '@babel/core'
* @import {BooleanLiteral, NullLiteral, NumericLiteral, StringLiteral} from '@babel/types'
*/

/**
* @typedef Options
* Configuration (required).
* @property {string|Array<string>} modules
* @property {Array<string> | string} modules
* List of modules to inline
* @property {boolean} [ignoreModuleNotFound=false]
* Ignore the error when modules cannot be found
*
* @typedef {import('@babel/core').PluginObj} PluginObj
* @typedef {import('@babel/core').PluginPass} PluginPass
* @typedef {import('@babel/core').NodePath} NodePath
* @typedef {import('@babel/types').StringLiteral} StringLiteral
* @typedef {import('@babel/types').NumericLiteral} NumericLiteral
* @typedef {import('@babel/types').BooleanLiteral} BooleanLiteral
* @typedef {import('@babel/types').NullLiteral} NullLiteral
* @typedef {import('@babel/types').ImportSpecifier} ImportSpecifier
* @typedef {import('@babel/types').ImportDefaultSpecifier} ImportDefaultSpecifier
* @typedef {import('@babel/types').ImportNamespaceSpecifier} ImportNamespaceSpecifier
*/

import {pathToFileURL} from 'node:url'
Expand All @@ -28,7 +22,7 @@ const conditions = new Set(['node', 'import'])
const own = {}.hasOwnProperty

/**
* @param {import('@babel/core')} babel
* @param {Babel} babel
* @param {Options} options
* @param {string} cwd
* @returns {Promise<PluginObj>}
Expand Down

0 comments on commit f3674b9

Please sign in to comment.