Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix on with rollup #7651

Merged
merged 11 commits into from
Mar 14, 2024
3 changes: 3 additions & 0 deletions examples/with-rollup/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// This configuration only applies to the package manager root.
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["@repo/eslint-config/library.js"],
ignorePattern: ["apps/**", "packages/**"],
};
2 changes: 1 addition & 1 deletion examples/with-rollup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ This Turborepo includes the following packages/apps:

### Apps and Packages

- `ui`: a React component library used by the `web` application, compiled with Rollup
- `web`: a [Next.js](https://nextjs.org) app
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
- `@repo/ui`: a React component library used by the `web` application, compiled with Rollup

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

Expand Down
2 changes: 1 addition & 1 deletion examples/with-rollup/apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pnpm dev

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

Expand Down
8 changes: 7 additions & 1 deletion examples/with-rollup/apps/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"next.config.js"
],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion examples/with-rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"turbo": "^1.12.2"
},
"packageManager": "pnpm@8.9.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
ignorePatterns: [
// Ignore dotfiles
".*.js",
".*.cjs",
"node_modules/",
"dist/",
],
Expand Down
6 changes: 5 additions & 1 deletion examples/with-rollup/packages/ui/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ export default [
file: "dist/header.js",
},
},
].map((entry) => ({ ...entry, plugins: [typescript()] }));
].map((entry) => ({
...entry,
external: ["react/jsx-runtime"],
plugins: [typescript()],
}));