Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nine-rats-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@slashid/react": patch
---

Properly externalize deps
2 changes: 1 addition & 1 deletion .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
bundle-size:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20.9.0]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container: "mcr.microsoft.com/playwright:v1.42.1-jammy"
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
release:
name: Release
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
Expand Down
11 changes: 9 additions & 2 deletions packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { resolve } from "node:path";
import { defineConfig } from "vite";
import { config } from "./vite.shared";

import * as packageJson from "./package.json";

export default defineConfig({
...config,
build: {
Expand All @@ -11,8 +13,13 @@ export default defineConfig({
fileName: `main`,
},
rollupOptions: {
// these must appear exactly as imported => having react here won't prevent react/jsx-runtime being bundled, so it must be explicit
external: ["react", "react/jsx-runtime", "react-dom", "react-dom/client"],
external: [
// include all the keys from peerDependencies by default
...Object.keys(packageJson.peerDependencies),
// these must be specified explicitly as they are not matched by react and react-dom from peer deps
"react/jsx-runtime",
"react-dom/client",
],
},
sourcemap: true,
},
Expand Down
Loading