Creating a RWN package
How to make css in a package that you use react-with-native in?
It's important that you create a CSS file that people can import in their project if they use your package. There are a couple of steps involved to do this.
- Create a
tailwind.config.js
file
module.exports = {
content: ["./src/**/*.{ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
- Install some devDependencies:
yarn add -D tailwindcss tsc-watch
- Add this to your package.json scripts
{
"dev": "npx tsc-watch --onSuccess 'yarn css'",
"css": "tailwindcss -o css.css"
}
That's it!
Creating a RWN package
How to make css in a package that you use react-with-native in?
It's important that you create a CSS file that people can import in their project if they use your package. There are a couple of steps involved to do this.
- Create a
tailwind.config.js
file
module.exports = {
content: ["./src/**/*.{ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
- Install some devDependencies:
yarn add -D tailwindcss tsc-watch
- Add this to your package.json scripts
{
"dev": "npx tsc-watch --onSuccess 'yarn css'",
"css": "tailwindcss -o css.css"
}
That's it!