Skip to content

Commit 5da2a63

Browse files
layershifterclaude
andcommitted
refactor: replace rollup with tsc for browser package builds
Replace rollup with dual tsc configs (ESM + CJS) for core, react, shadow-dom, and style-types. Each package now has a tsconfig.lib.cjs.json that emits CJS to dist/cjs/ using module: "node16". - Delete rollup.config.cjs from 4 browser packages - Add tsconfig.lib.cjs.json for CJS output - Add explicit build targets in project.json (ESM + CJS) - Update exports to ./dist/index.js and ./dist/cjs/index.js - Remove @nx/rollup/plugin from nx.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9bd737f commit 5da2a63

17 files changed

Lines changed: 108 additions & 74 deletions

nx.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@
5454
"configName": "tsconfig.lib.json"
5555
}
5656
}
57-
},
58-
{
59-
"plugin": "@nx/rollup/plugin",
60-
"options": {
61-
"buildTargetName": "build"
62-
}
6357
}
6458
],
6559
"pluginsConfig": {

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
".": {
1818
"@griffel/source": "./src/index.ts",
1919
"types": "./dist/index.d.ts",
20-
"import": "./dist/index.esm.js",
21-
"require": "./dist/index.cjs.js",
22-
"default": "./dist/index.esm.js"
20+
"import": "./dist/index.js",
21+
"require": "./dist/cjs/index.js",
22+
"default": "./dist/index.js"
2323
}
2424
},
2525
"dependencies": {

packages/core/project.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
"projectType": "library",
66
"tags": [],
77
"targets": {
8+
"build": {
9+
"dependsOn": ["^build"],
10+
"executor": "nx:run-commands",
11+
"outputs": ["{projectRoot}/dist"],
12+
"options": {
13+
"cwd": "{projectRoot}",
14+
"commands": ["tsc -b tsconfig.lib.json --pretty", "tsc -p tsconfig.lib.cjs.json --pretty"],
15+
"parallel": false
16+
}
17+
},
818
"lint": {
919
"executor": "@nx/eslint:lint",
1020
"outputs": ["{options.outputFile}"]

packages/core/rollup.config.cjs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.lib.json",
3+
"compilerOptions": {
4+
"module": "node16",
5+
"moduleResolution": "node16",
6+
"outDir": "./dist/cjs",
7+
"composite": false,
8+
"declaration": false,
9+
"declarationMap": false,
10+
"sourceMap": false,
11+
"incremental": false
12+
},
13+
"references": []
14+
}

packages/react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
".": {
1818
"@griffel/source": "./src/index.ts",
1919
"types": "./dist/index.d.ts",
20-
"import": "./dist/index.esm.js",
21-
"require": "./dist/index.cjs.js",
22-
"default": "./dist/index.esm.js"
20+
"import": "./dist/index.js",
21+
"require": "./dist/cjs/index.js",
22+
"default": "./dist/index.js"
2323
}
2424
},
2525
"wyw-in-js": {

packages/react/project.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
"projectType": "library",
66
"tags": [],
77
"targets": {
8+
"build": {
9+
"dependsOn": ["^build"],
10+
"executor": "nx:run-commands",
11+
"outputs": ["{projectRoot}/dist"],
12+
"options": {
13+
"cwd": "{projectRoot}",
14+
"commands": ["tsc -b tsconfig.lib.json --pretty", "tsc -p tsconfig.lib.cjs.json --pretty"],
15+
"parallel": false
16+
}
17+
},
818
"lint": {
919
"executor": "@nx/eslint:lint",
1020
"outputs": ["{options.outputFile}"]

packages/react/rollup.config.cjs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.lib.json",
3+
"compilerOptions": {
4+
"module": "node16",
5+
"moduleResolution": "node16",
6+
"outDir": "./dist/cjs",
7+
"composite": false,
8+
"declaration": false,
9+
"declarationMap": false,
10+
"sourceMap": false,
11+
"incremental": false
12+
},
13+
"references": []
14+
}

packages/shadow-dom/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
".": {
1818
"@griffel/source": "./src/index.ts",
1919
"types": "./dist/index.d.ts",
20-
"import": "./dist/index.esm.js",
21-
"require": "./dist/index.cjs.js",
22-
"default": "./dist/index.esm.js"
20+
"import": "./dist/index.js",
21+
"require": "./dist/cjs/index.js",
22+
"default": "./dist/index.js"
2323
}
2424
},
2525
"devDependencies": {

0 commit comments

Comments
 (0)