Skip to content

Simplify/cleanup config a bit#1

Open
micmro wants to merge 2 commits intods-samplefrom
ds-sample-michael
Open

Simplify/cleanup config a bit#1
micmro wants to merge 2 commits intods-samplefrom
ds-sample-michael

Conversation

@micmro
Copy link
Collaborator

@micmro micmro commented Apr 19, 2022

No description provided.

{
input: 'dist/esm/types/index.d.ts',
output: [{ file: 'dist/index.d.ts', format: 'esm' }],
plugins: [dts(), command('rm -r dist/{cjs,esm}/types')],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed generated types so only the dts rolled-up definitions are published

modules: true,
use: ['sass'],
}),
typescript({ tsconfig: './tsconfig.build.json' }),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use tsconfig.build.json so VS code allows typing for tests and storybook

sourcemap: true,
},
],
external: ['react', 'react-dom'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make react external so it does not get bundled

@@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extend the basic TypeScript config but overwrite exclude for the build

Comment on lines -40 to -42
"plugins": [
{ "name": "typescript-plugin-css-modules" }
]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used

{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src/custom.d.ts","src", "types"],
"exclude": ["**/*.test.tsx", "**/*.stories.tsx"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevented tests and storied from getting type checked

// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
// "noEmit": true,
"declarationDir": "types",
"typeRoots": ["./node_modules/@types/", "./src/custom.d.ts", "./src/react-app-env.d.ts"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not actually needed

"react-is": "^17.0.2",
"react-test-renderer": "^17.0.2",
"rollup": "^2.70.1",
"rollup-plugin-command": "^1.1.3",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to dev-dependencies

Comment on lines -123 to -127
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-import-css": "^3.0.3",
"rollup-plugin-sass": "^1.2.12",
"rollup-plugin-styles": "^4.0.0",
"typescript-plugin-css-modules": "^3.4.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used

@micmro micmro requested a review from rafRangler April 20, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant