@@ -19,74 +19,16 @@ const config: Config = defineBuildConfig({
1919 charset : 'utf8' ,
2020 entries : [
2121 { dts : 'only' } ,
22- { dts : false , pattern : [ '** /index.ts' , 'enums/*' , 'internal /*'] } ,
22+ { dts : false , pattern : [ '(interfaces|types) /index.ts' , 'enums/*' ] } ,
2323 {
2424 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
3228 }
3329 ] ,
3430 minifySyntax : true ,
3531 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- } ,
9032 {
9133 name : 'ts-ignore-peers' ,
9234
0 commit comments