-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
allow custom component authors to provide custom vite plugins and svelte preprocessors #6787
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/4aea4918958e72f36eec9b3c7de86f34d9aa6054/gradio-4.27.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@4aea4918958e72f36eec9b3c7de86f34d9aa6054#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
We need to do something else. |
Important Outdated! Updated instructions. To test this: run Copy paste this code in to the import tailwindcss from "@tailwindcss/vite";
export default {
plugins: [tailwindcss()]
}; Add this file in the frontend dir:
@import "tailwindcss"; Add this code to import './main.css'; Run this command in the pnpm add -D tailwindcss@next @tailwindcss/vite@next cd back into gradio cc install --npm-install="pnpm i"
gradio cc dev |
tbh i'll just push these changes |
New instructions:
then visit the URL shown in the console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @pngwn ! Let's please write some docs for this in the frontend guide: https://www.gradio.app/guides/frontend
I still think we should provide an empty gradio.config.js
file in the create command so that users know about it without having to use the guides. Maybe we include some commented out code like "to add tailwind, add the following"
Good idea. Will update. |
@freddyaboulton I have done the following:
|
|
||
The `gradio.config.js` file should be placed in the root of your component's `frontend` directory. A default config file is created for you when you create a new component. But you can also create your own config file and use it to customize your component's build process. | ||
|
||
```typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah nice catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs changes look good to me @pngwn !
Description
Please include a concise summary, in clear English, of the changes in this pull request. If it closes an issue, please mention it here.
Closes #8044. Closes #7927. Closes #7006.
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh