File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 "preprofile" : " npm run prepare" ,
2828 "profile" : " make -C benchmark profile"
2929 },
30- "main" : " ./dist/commonjs/index.js" ,
30+ "main" : " ./dist/commonjs/index.min. js" ,
3131 "types" : " ./dist/commonjs/index.d.ts" ,
3232 "tshy" : {
3333 "exports" : {
34- "." : " ./src/index.ts" ,
35- "./min " : {
34+ "./raw " : " ./src/index.ts" ,
35+ "." : {
3636 "import" : {
3737 "types" : " ./dist/esm/index.d.ts" ,
3838 "default" : " ./dist/esm/index.min.js"
7575 ]
7676 },
7777 "exports" : {
78- "." : {
78+ "./raw " : {
7979 "import" : {
8080 "types" : " ./dist/esm/index.d.ts" ,
8181 "default" : " ./dist/esm/index.js"
8585 "default" : " ./dist/commonjs/index.js"
8686 }
8787 },
88- "./min " : {
88+ "." : {
8989 "import" : {
9090 "types" : " ./dist/esm/index.d.ts" ,
9191 "default" : " ./dist/esm/index.min.js"
9797 }
9898 },
9999 "type" : " module" ,
100- "module" : " ./dist/esm/index.js"
100+ "module" : " ./dist/esm/index.min. js"
101101}
Original file line number Diff line number Diff line change @@ -11,11 +11,16 @@ t.test('verify require works as expected', async t => {
1111 const req = createRequire ( import . meta. url )
1212 t . equal (
1313 req . resolve ( '../' ) ,
14- req . resolve ( '../dist/commonjs/index.js' ) ,
14+ req . resolve ( '../dist/commonjs/index.min. js' ) ,
1515 'require resolves to expected module' ,
1616 )
17- const { LRUCache } = await t . mockImport ( '../dist/esm/index.js' , { } )
17+ const { LRUCache } = await t . mockImport ( '../dist/esm/index.js' )
18+ const { LRUCache : LRUCacheRaw } = await t . mockImport ( 'lru-cache/raw' )
1819 t . equal ( LRUCache . toString ( ) . split ( / \r ? \n / ) [ 0 ] . trim ( ) , 'class LRUCache {' )
20+ t . equal ( LRUCache . toString ( ) , LRUCacheRaw . toString ( ) , './raw endpoint is unminified' )
21+ const { LRUCache : LRUCacheMain } = await t . mockImport ( 'lru-cache' )
22+ const { LRUCache : LRUCacheMin } = await t . mockImport ( '../dist/esm/index.min.js' )
23+ t . equal ( LRUCacheMin . toString ( ) , LRUCacheMain . toString ( ) )
1924} )
2025
2126t . test ( 'basic operation' , t => {
You can’t perform that action at this time.
0 commit comments