Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 9a80e87

Browse files
committed
chore: make monorepo ESM and bump release-scripts
1 parent e5b4ad8 commit 9a80e87

File tree

5 files changed

+120
-13
lines changed

5 files changed

+120
-13
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@vitejs/plugin-react-swc-monorepo",
33
"version": "3.1.0-beta.2",
4+
"type": "module",
45
"private": true,
56
"scripts": {
67
"dev": "tsx scripts/bundle.ts --dev",
@@ -9,7 +10,7 @@
910
"prettier": "pnpm prettier-ci --write",
1011
"prettier-ci": "prettier --cache --ignore-path=.gitignore --check '**/*.{js,jsx,ts,tsx,html,css,json,md,yml}'",
1112
"ci": "tsc && pnpm prettier-ci && pnpm build && cd playground && tsc && cd .. && pnpm test",
12-
"release": "tsx scripts/release.ts"
13+
"release": "pnpm build && tsx scripts/release.ts"
1314
},
1415
"prettier": {
1516
"trailingComma": "all"
@@ -24,7 +25,7 @@
2425
"@playwright/test": "^1.29.2",
2526
"@types/fs-extra": "^11.0.1",
2627
"@types/node": "^18.11.18",
27-
"@vitejs/release-scripts": "^1.0.4",
28+
"@vitejs/release-scripts": "^1.1.0",
2829
"esbuild": "^0.17.4",
2930
"fs-extra": "^11.1.0",
3031
"picocolors": "^1.0.0",

playwright.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { fileURLToPath } from "node:url";
12
import { devices, PlaywrightTestConfig } from "@playwright/test";
2-
import { resolve } from "node:path";
3-
import * as fs from "fs-extra";
3+
import fs from "fs-extra";
44

5-
const tempDir = resolve(__dirname, "playground-temp");
5+
const tempDir = fileURLToPath(new URL("playground-temp", import.meta.url));
66
fs.ensureDirSync(tempDir);
77
fs.emptyDirSync(tempDir);
8-
fs.copySync(resolve(__dirname, "playground"), tempDir, {
8+
fs.copySync(fileURLToPath(new URL("playground", import.meta.url)), tempDir, {
99
filter: (src) =>
1010
!src.includes("/__tests__") &&
1111
!src.includes("/.vite") &&

pnpm-lock.yaml

Lines changed: 110 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ module.exports.default = react;`,
7272
module: "index.mjs",
7373
exports: {
7474
".": {
75-
require: "./index.cjs",
7675
types: "./index.d.ts",
76+
require: "./index.cjs",
7777
import: "./index.mjs",
7878
},
7979
},

scripts/release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { readFileSync, writeFileSync } from "fs";
1+
import { readFileSync, writeFileSync } from "node:fs";
22
import { release } from "@vitejs/release-scripts";
3-
import * as colors from "picocolors";
3+
import colors from "picocolors";
44

55
const changelog = readFileSync("CHANGELOG.md", "utf-8");
66

0 commit comments

Comments
 (0)