FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
unplugin-isolated-decl/src/core/options.ts at main · unplugin/unplugin-isolated-decl · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
unplugin
/
unplugin-isolated-decl
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
8
Star
193
Code
Issues
3
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
unplugin-isolated-decl
/
src
/
core
/
options.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
76 lines (72 loc) · 2.18 KB
Breadcrumbs
unplugin-isolated-decl
/
src
/
core
/
options.ts
Copy path
File metadata and controls
76 lines (72 loc) · 2.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import
type
{
IsolatedDeclarationsOptions
}
from
'oxc-transform'
import
type
{
TranspileOptions
}
from
'typescript'
import
type
{
FilterPattern
}
from
'unplugin'
/**
* Represents the options for the plugin.
*/
export
type
Options
=
{
include
?:
FilterPattern
exclude
?:
FilterPattern
enforce
?:
'pre'
|
'post'
|
undefined
/**
* Whether to generate declaration source maps.
*
* Supported by `typescript` and `oxc` transformer only.
*
*
@link
https://www.typescriptlang.org/tsconfig/#declarationMap
*/
sourceMap
?:
boolean
ignoreErrors
?:
boolean
/** An extra directory layer for output files. */
extraOutdir
?:
string
/** Patch `export default` in `.d.cts` to `export = ` */
patchCjsDefaultExport
?:
boolean
/** Base directory for input files. */
inputBase
?:
string
rewriteImports
?:
(
id
:
string
,
importer
:
string
,
)
=>
string
|
void
|
null
|
undefined
}
&
(
|
{
/**
*
@default
'oxc'
*/
transformer
?:
'oxc'
transformOptions
?:
Omit
<
IsolatedDeclarationsOptions
,
'sourceMap'
>
}
|
{
/**
* `@swc/core` should be installed yourself.
*/
transformer
?:
'swc'
}
|
{
/**
* `typescript` should be installed yourself.
*/
transformer
?:
'typescript'
/** Only for typescript transformer */
transformOptions
?:
TranspileOptions
}
)
type
Overwrite
<
T
,
U
>
=
Pick
<
T
,
Exclude
<
keyof
T
,
keyof
U
>
>
&
U
export
type
OptionsResolved
=
Overwrite
<
Required
<
Options
>
&
{
transformOptions
?:
any
}
,
Pick
<
Options
,
'enforce'
|
'extraOutdir'
|
'rewriteImports'
|
'inputBase'
>
>
export
function
resolveOptions
(
options
:
Options
)
:
OptionsResolved
{
return
{
include
:
options
.
include
||
[
/
\.
[
c
m
]
?
t
s
x
?
$
/
]
,
exclude
:
options
.
exclude
||
[
/
n
o
d
e
_
m
o
d
u
l
e
s
/
]
,
enforce
:
'enforce'
in
options
?
options
.
enforce
:
'pre'
,
sourceMap
:
options
.
sourceMap
||
false
,
transformer
:
options
.
transformer
||
'oxc'
,
ignoreErrors
:
options
.
ignoreErrors
||
false
,
extraOutdir
:
options
.
extraOutdir
,
patchCjsDefaultExport
:
options
.
patchCjsDefaultExport
||
false
,
rewriteImports
:
options
.
rewriteImports
,
inputBase
:
options
.
inputBase
,
transformOptions
:
(
options
as
any
)
.
transformOptions
,
}
}
Back
|
FazBrowse Home
|
New Git URL