fix(core): remove hash prefix from cdn path (#5509)

The hash prefix will cause cache invalidate during deployment
It's for debug purpose but I forgot to remove it
This commit is contained in:
LongYinan
2024-01-18 03:50:24 +00:00
parent 943ede4ffd
commit aa437bcd35
3 changed files with 21 additions and 21 deletions

View File

@@ -1,14 +1,27 @@
import { createConfiguration, rootPath } from './config.js';
import { merge } from 'webpack-merge';
import { execSync } from 'node:child_process';
import { join, resolve } from 'node:path';
import { once } from 'lodash-es';
import { merge } from 'webpack-merge';
import type { BuildFlags } from '@affine/cli/config';
import { getRuntimeConfig } from './runtime-config.js';
import HTMLPlugin from 'html-webpack-plugin';
import { gitShortHash } from './s3-plugin.js';
import { getRuntimeConfig } from './runtime-config.js';
import { createConfiguration, rootPath } from './config.js';
const DESCRIPTION = `There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together.`;
const gitShortHash = once(() => {
const { GITHUB_SHA } = process.env;
if (GITHUB_SHA) {
return GITHUB_SHA.substring(0, 9);
}
const sha = execSync(`git rev-parse --short HEAD`, {
encoding: 'utf-8',
}).trim();
return sha;
});
export default async function (cli_env: any, _: any) {
const flags: BuildFlags = JSON.parse(
Buffer.from(cli_env.flags, 'hex').toString('utf-8')