Skip to content

Commit 8de3e52

Browse files
Merge branch 'ronith/add-hosting-config-files' of https://github.com/stackblitz/tutorialkit into ronith/add-hosting-config-files
2 parents a1771db + 675c5fb commit 8de3e52

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/cli/src/commands/create/generate-hosting-config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function generateHostingConfig(dest: string, flags: CreateOptions)
2525
})) as string;
2626
}
2727

28-
if (provider === 'skip') {
28+
if (!provider || provider === 'skip') {
2929
prompts.log.message(
3030
`${chalk.blue('hosting provider config [skip]')} You can configure hosting provider settings manually later.`,
3131
);
@@ -44,18 +44,18 @@ export async function generateHostingConfig(dest: string, flags: CreateOptions)
4444
let config: string | undefined;
4545
let filename: string | undefined;
4646

47-
switch (provider) {
48-
case 'Vercel': {
47+
switch (provider.toLowerCase()) {
48+
case 'vercel': {
4949
config = typeof vercelConfigRaw === 'string' ? vercelConfigRaw : JSON.stringify(vercelConfigRaw, null, 2);
5050
filename = 'vercel.json';
5151
break;
5252
}
53-
case 'Netlify': {
53+
case 'netlify': {
5454
config = netlifyConfigRaw;
5555
filename = 'netlify.toml';
5656
break;
5757
}
58-
case 'Cloudflare': {
58+
case 'cloudflare': {
5959
config = cloudflareConfigRaw;
6060
filename = '_headers';
6161
break;

packages/cli/src/commands/create/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function updatePackageJson(dest: string, projectName: string, flags: CreateOptio
268268
updateWorkspaceVersions(pkgJson.dependencies, TUTORIALKIT_VERSION);
269269
updateWorkspaceVersions(pkgJson.devDependencies, TUTORIALKIT_VERSION);
270270

271-
if (provider === 'Netlify' || provider === 'Cloudflare') {
271+
if (provider.toLowerCase() === 'cloudflare') {
272272
pkgJson.scripts = pkgJson.scripts || {};
273273
pkgJson.scripts.postbuild = 'cp _headers ./dist/';
274274
}

0 commit comments

Comments
 (0)