parent
b67779d1dd
commit
5e0cb796a6
2 changed files with 9 additions and 0 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -21,6 +21,8 @@ jobs:
|
|||
include:
|
||||
- os: windows-latest
|
||||
node_version: 16
|
||||
- os: macos-latest
|
||||
node_version: 16
|
||||
fail-fast: false
|
||||
env:
|
||||
LANG: en-us
|
||||
|
|
|
@ -6,6 +6,7 @@ import type { AstroConfig } from '../@types/astro-core';
|
|||
import esbuild from 'esbuild';
|
||||
import fs from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
import os from 'os';
|
||||
import { transform } from '@astrojs/compiler';
|
||||
import { decode } from 'sourcemap-codec';
|
||||
import { AstroDevServer } from '../core/dev/index.js';
|
||||
|
@ -79,6 +80,12 @@ export default function astro({ config, devServer }: AstroPluginOptions): vite.P
|
|||
return { code: result.code, map };
|
||||
},
|
||||
});
|
||||
|
||||
// macOS fix: remove null chars generated by compiler
|
||||
if (os.platform() === 'darwin') {
|
||||
tsResult.code = tsResult.code.replace(/\x00/g, '');
|
||||
}
|
||||
|
||||
// Compile `.ts` to `.js`
|
||||
const { code, map } = await esbuild.transform(tsResult.code, { loader: 'ts', sourcemap: 'external', sourcefile: id });
|
||||
|
||||
|
|
Loading…
Reference in a new issue