-
Notifications
You must be signed in to change notification settings - Fork 922
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
Add a shape to the TS config files #1466
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/r7n10mnpt |
Love this! +1 for adding to the JS templates as well. 1 comment: |
Cool, great point - updated to that type, and added to al the JS templates too |
Thanks! If you run |
thanks! |
Is it, or have I misunderstood something? Please try the following example: import type {SnowpackUserConfig} from "snowpack";
const config: SnowpackUserConfig = {
mount: {
"public": "/",
"src": "/_dist_",
},
plugins: [
"@snowpack/plugin-react-refresh",
"@snowpack/plugin-dotenv",
"@snowpack/plugin-typescript",
],
};
export default config; I get a lot of errors:
EDIT: Otherwise, supporting TypeScript in configuration is wonderful! |
Ah good catch, now that this is user-facing |
Changes
Adds a JSDoc comment to add types to the config files with the TypeScript CRA templates
After:
Testing
Tested in my own CRA project, which I ported
Docs
Not needed
Question:
Do you want this on all the JS templates too? IMO it's good for everyone, but I'm obv biased ;)