astro:cache

This commit is contained in:
babayaga 2025-12-31 12:33:17 +01:00
parent 73a12c95e3
commit 4e97104eb0
6 changed files with 10 additions and 35 deletions

View File

@ -4,7 +4,7 @@ import { type MaybePromise, type Thunk } from './utils.js';
import { type PersistedMetadata, RenderFileStore } from './renderFileStore.js';
import { inMemoryCacheHit, inMemoryCacheMiss } from './metrics.js';
import { MemoryCache } from './inMemoryLRU.js';
import { FactoryValueClone } from './factoryValueClone.ts';
import { FactoryValueClone } from './factoryValueClone.js';
const debug = rootDebug.extend('cache');

View File

@ -1,5 +1,5 @@
import type { RenderTemplateResult } from 'astro/runtime/server/render/astro/render-template.js';
import { runtime, type Thunk } from './utils.ts';
import { runtime, type Thunk } from './utils.js';
import type {
RenderDestination,
RenderDestinationChunk,

View File

@ -19,7 +19,7 @@ import {
import type { ContextTracking } from './contextTracking.js';
import { MemoryCache } from './inMemoryLRU.js';
import murmurHash from 'murmurhash-native';
import { FactoryValueClone } from './factoryValueClone.ts';
import { FactoryValueClone } from './factoryValueClone.js';
const gzip = promisify(zlib.gzip),
gunzip = promisify(zlib.gunzip);

View File

@ -11,7 +11,9 @@
"declarationMap": true,
"sourceMap": true,
"types": ["node"],
"skipLibCheck": true
"skipLibCheck": true,
"noEmit": false,
"allowImportingTsExtensions": false
},
"include": ["src/**/*", "env.d.ts"],
"exclude": ["dist", "node_modules", "tests"]

View File

@ -1,27 +0,0 @@
import { defineConfig } from 'tsup';
import { peerDependencies, dependencies, devDependencies } from './package.json';
export default defineConfig((options) => {
const dev = !!options.watch;
return {
entry: ['src/index.ts'],
format: ['esm'],
target: 'node18',
bundle: true,
dts: true,
sourcemap: true,
clean: true,
splitting: false,
minify: !dev,
noExternal: Object.keys(devDependencies),
external: [
...Object.keys(peerDependencies),
...Object.keys(dependencies),
/node_modules/g,
'recast',
'tslib',
],
tsconfig: 'tsconfig.json',
treeshake: 'smallest',
};
});

View File

@ -1,12 +1,12 @@
export default {
"environment": "build",
"environment": "dev",
"isSsrBuild": false,
"projectBase": "",
"publicDir": "C:\\Users\\zx\\Desktop\\polymech\\library.polymech\\public\\",
"rootDir": "C:\\Users\\zx\\Desktop\\polymech\\library.polymech\\",
"mode": "production",
"outDir": "C:\\Users\\zx\\Desktop\\polymech\\library.polymech\\dist\\",
"assetsDir": "_astro",
"mode": "dev",
"outDir": "dist",
"assetsDir": "/_astro",
"sourcemap": "inline",
"assetFileNames": "/_astro/[name]@[width].[hash][extname]"
}