Example how to build custom library with:
- Vite.js Library mode
- Rollup TBD
This turborepo uses Yarn as a package manager. It includes the following packages/apps:
├── apps
│ ├── example-app
│ │ ├── vite.config.js
├── packages
│ ├── vitejs-library-base-setup
│ │ ├── .storybook
│ ├── rollup-library-base-setup
example-app
: Vite.js exampole app to test librariesvitejs-library-base-setup
: Vite.js library based on Library Modeollup-library-base-setup
: Rollup library TBD
This turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
- Autoprefixer parse CSS and add vendor prefixes
To build all apps and packages, run the following command:
yarn build
To run example-app
yarn dev
To build separate libvraries
cd packages/[library name]
yarn build
create postcss.congif.js
export default {
plugins: {
autoprefixer: {},
},
}
and to package.json
add
"browserslist": [
"> 1%",
"last 5 versions"
]