avitorio / react

Standard styles and dependencies for React TS Modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tsmodule component library

This is a tsmodule component library developed and previewed with Next.js.

Develop

To start the Next server and develop your components, use next dev or the yarn dev script:

yarn dev
# calls `next dev`

Export and publish

To export your component library, use tsmodule build or the yarn export script:

yarn export
# calls `tsmodule build`

You can then publish to NPM:

yarn publish

Importing from your component library

To reuse your components:

  1. Import your component styles via import "my-library/styles".
  2. Import your component and render it via import { MyComponent } from "my-library/MyComponent.

Footnotes

Styles are exported in dist/, and are also bundled to dist/bundle.css from the entrypoint given in the style package.json.

The default behavior is to export all component styles, i.e. src/styles/components/index.css ➞ dist/bundle.css. This can be overridden with tsmodule's --styles flag, i.e. tsmodule build --styles src/styles/index.css (which would include all styles in emitted bundle).

About

Standard styles and dependencies for React TS Modules.

License:MIT License


Languages

Language:CSS 60.6%Language:TypeScript 28.1%Language:JavaScript 11.3%