File tree 2 files changed +14
-17
lines changed
2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -532,6 +532,20 @@ Size Limits supports three ways to define limits config.
532
532
]
533
533
` ` `
534
534
535
+ 4. or types ` .size-limit.ts` :
536
+
537
+ ` ` ` ts
538
+ import type { SizeLimitConfig } from ' ../../packages/size-limit'
539
+
540
+ module.exports = [
541
+ {
542
+ path: " index.js" ,
543
+ import: " { createStore }" ,
544
+ limit: " 500 ms"
545
+ }
546
+ ] satisfies SizeLimitConfig
547
+ ` ` `
548
+
535
549
Each section in the config can have these options:
536
550
537
551
* ** path** : relative paths to files. The only mandatory option.
Original file line number Diff line number Diff line change @@ -83,25 +83,8 @@ function toName(files, cwd) {
83
83
return files . map ( i => ( i . startsWith ( cwd ) ? relative ( cwd , i ) : i ) ) . join ( ', ' )
84
84
}
85
85
86
- /**
87
- * Dynamically imports a module from a given file path
88
- * and returns its default export.
89
- *
90
- * @param {string } filePath - The path to the module file to be imported.
91
- * @returns {Promise<any> } A promise that resolves with the default export of the module.
92
- */
93
86
const dynamicImport = async filePath => ( await import ( filePath ) ) . default
94
87
95
- /**
96
- * Loads a TypeScript file from a given file path using the
97
- * {@linkcode jiti} function. This loader function simplifies the
98
- * process of dynamically importing TypeScript modules at runtime,
99
- * offering a way to execute or import TypeScript files directly
100
- * without pre-compilation.
101
- *
102
- * @param {string } filePath - The path to the TypeScript file to be loaded.
103
- * @returns {Promise<any> } The module exports from the loaded TypeScript file.
104
- */
105
88
const tsLoader = async filePath => {
106
89
let jiti = ( await import ( 'jiti' ) ) . default ( fileURLToPath ( import . meta. url ) , {
107
90
interopDefault : true
You can’t perform that action at this time.
0 commit comments