@@ -19,74 +19,16 @@ const config: Config = defineBuildConfig({
19
19
charset : 'utf8' ,
20
20
entries : [
21
21
{ dts : 'only' } ,
22
- { dts : false , pattern : [ '** /index.ts' , 'enums/*' , 'internal /*'] } ,
22
+ { dts : false , pattern : [ '(interfaces|types) /index.ts' , 'enums/*' ] } ,
23
23
{
24
24
dts : false ,
25
- pattern : [ 'index.ts' , 'utils/*' ] ,
26
- sourceRoot : pathe . join (
27
- pkg . repository . replace ( / \. g i t $ / , pathe . sep + 'blob' ) ,
28
- pkg . tagPrefix + pkg . version
29
- ) ,
30
- sourcemap : true ,
31
- sourcesContent : false
25
+ pattern : [ 'index.ts' , 'internal/*' , 'utils/*' ] ,
26
+ sourceRoot : 'file' + pathe . delimiter + pathe . sep . repeat ( 2 ) ,
27
+ sourcemap : true
32
28
}
33
29
] ,
34
30
minifySyntax : true ,
35
31
plugins : [
36
- {
37
- name : 'fix-sourcemaps' ,
38
-
39
- /**
40
- * Makes sourcemap files relative to [`sourceRoot`][1].
41
- *
42
- * [1]: https://esbuild.github.io/api/#source-root
43
- * [2]: https://esbuild.github.io/plugins
44
- *
45
- * @see https://github.com/evanw/esbuild/issues/2218
46
- *
47
- * @param {PluginBuild } build - [esbuild plugin api][2]
48
- * @param {PluginBuild['onEnd'] } build.onEnd - Build end callback
49
- * @return {void } Nothing when complete
50
- */
51
- setup ( { initialOptions, onEnd } : PluginBuild ) : void {
52
- return void onEnd ( ( result : BuildResult < { write : false } > ) : void => {
53
- const { absWorkingDir = process . cwd ( ) } = initialOptions
54
-
55
- return void ( result . outputFiles = result . outputFiles . map ( output => {
56
- if ( output . path . endsWith ( '.map' ) ) {
57
- /**
58
- * Relative path to output file sourcemap is for.
59
- *
60
- * **Note**: Relative to {@linkcode absWorkingDir}.
61
- *
62
- * @const {string} outfile
63
- */
64
- const outfile : string = output . path
65
- . replace ( absWorkingDir , '' )
66
- . replace ( / ^ \/ / , '' )
67
- . replace ( / \. m a p $ / , '' )
68
-
69
- /**
70
- * Parsed sourcemap object.
71
- *
72
- * @const {{ sources: string[] }}
73
- */
74
- const map : { sources : string [ ] } = JSON . parse ( output . text )
75
-
76
- // reset sources to outfile entry point
77
- map . sources = [ result . metafile ! . outputs [ outfile ] ! . entryPoint ! ]
78
-
79
- // redefine outfile text
80
- Object . defineProperty ( output , 'text' , {
81
- get : ( ) : string => JSON . stringify ( map , null , 2 )
82
- } )
83
- }
84
-
85
- return output
86
- } ) )
87
- } )
88
- }
89
- } ,
90
32
{
91
33
name : 'ts-ignore-peers' ,
92
34
0 commit comments