Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: fix tar esm issue #48442

Merged
merged 2 commits into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/visual-regression/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { remark } from 'remark';
import remarkGfm from 'remark-gfm';
import remarkHtml from 'remark-html';
import sharp from 'sharp';
import tar from 'tar';

const ROOT_DIR = process.cwd();
const ALI_OSS_BUCKET = 'antd-visual-diff';
Expand Down Expand Up @@ -106,6 +105,7 @@ async function getBranchLatestRef(branchName: string) {
}

async function downloadBaseSnapshots(ref: string, targetDir: string) {
const tar = await import('tar');
vagusX marked this conversation as resolved.
Show resolved Hide resolved
// download imageSnapshotsUrl
const imageSnapshotsUrl = `${ossDomain}/${ref}/imageSnapshots.tar.gz`;
const targzPath = path.resolve(os.tmpdir(), `./${path.basename(targetDir)}.tar.gz`);
Expand Down Expand Up @@ -350,7 +350,7 @@ async function boot() {
htmlTemplate.replace('{{reportContent}}', reportHtmlStr),
'utf-8',
);

const tar = await import('tar');
await tar.c(
{
gzip: true,
Expand Down