diff options
author | 2023-02-16 23:16:07 +0800 | |
---|---|---|
committer | 2023-02-16 09:16:07 -0600 | |
commit | ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec (patch) | |
tree | 681c11211a396616ac48fe0cf10fcbca96b521db /packages/integrations/deno/src/index.ts | |
parent | 0049fda62fa8650a0d250adb00a2c5d82679aeaf (diff) | |
download | astro-ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec.tar.gz astro-ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec.tar.zst astro-ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec.zip |
Deno fix #6131 (#6248)
* fix: #6131
* fix: delete
* update code
* fix: fix bug
* add some tests
* fix route error
* delete comment
* delete trash code
---------
Co-authored-by: wuls <linsheng.wu@beantechs.com>
Diffstat (limited to 'packages/integrations/deno/src/index.ts')
-rw-r--r-- | packages/integrations/deno/src/index.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts index 82da15188..891623ead 100644 --- a/packages/integrations/deno/src/index.ts +++ b/packages/integrations/deno/src/index.ts @@ -3,6 +3,7 @@ import esbuild from 'esbuild'; import * as fs from 'fs'; import * as npath from 'path'; import { fileURLToPath } from 'url'; +import * as CONSTANT from './code-constant' interface BuildConfig { server: URL; @@ -70,6 +71,8 @@ export default function createIntegration(args?: Options): AstroIntegration { 'astro:build:done': async () => { const entryUrl = new URL(_buildConfig.serverEntry, _buildConfig.server); const pth = fileURLToPath(entryUrl); + const content = await fs.readFileSync(pth, 'utf8') + await fs.writeFileSync(pth, `${CONSTANT.DEFAULTIMPORT}${content}${CONSTANT.DEFAULTSTART}`); await esbuild.build({ target: 'es2020', platform: 'browser', |