From df258e40bd24187a4f6ceaa6da74155794cda944 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Thu, 6 Mar 2025 22:22:31 -0700 Subject: [PATCH] Configure Cross-Origin headers --- .github/workflows/build.yml | 12 +++--------- public/_headers | 3 +++ rsbuild.config.ts | 7 +++++++ 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 public/_headers diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58b9bcb..0a0a8e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,8 @@ jobs: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v4 - - name: Setup Node.js + - name: Install Node uses: actions/setup-node@v4 - with: - cache: 'pnpm' - name: Install dependencies run: pnpm install - name: Check @@ -32,10 +30,8 @@ jobs: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v4 - - name: Setup Node.js + - name: Install Node uses: actions/setup-node@v4 - with: - cache: 'pnpm' - name: Install dependencies run: pnpm install - name: Build @@ -54,10 +50,8 @@ jobs: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v4 - - name: Setup Node.js + - name: Install Node uses: actions/setup-node@v4 - with: - cache: 'pnpm' - name: Install dependencies run: pnpm install - name: Build diff --git a/public/_headers b/public/_headers new file mode 100644 index 0000000..8fad4e7 --- /dev/null +++ b/public/_headers @@ -0,0 +1,3 @@ +/* + Cross-Origin-Resource-Policy: cross-origin + Cross-Origin-Embedder-Policy: require-corp diff --git a/rsbuild.config.ts b/rsbuild.config.ts index 3be9aa7..67e0697 100644 --- a/rsbuild.config.ts +++ b/rsbuild.config.ts @@ -107,6 +107,13 @@ const extensionConfig: RsbuildConfig = { hmr: false, liveReload: false, }, + // Disable copying the public directory. This is only useful + // for the web configuration. + server: { + publicDir: { + copyOnBuild: false, + }, + }, }; const buildType = process.env.BUILD_TYPE;