Skip to content
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

[legacy-framework] Add support for blitz.config.ts #2283

Merged
merged 5 commits into from
Apr 29, 2021
Merged

Conversation

flybayer
Copy link
Member

@flybayer flybayer commented Apr 29, 2021

Closes: blitz-js/legacy-framework#632

What are the changes and their implications?

Add support for blitz.config.ts. We use esbuild to bundle your blitz config file and output it at .blitz/blitz.config.js.

Feature Checklist

  • Integration test added (see test docs if needed)
  • Documentation added/updated (submit PR to blitzjs.com repo)
  • Update recipe installer
  • Test Vercel deployment

@flybayer flybayer merged commit 0086a1f into canary Apr 29, 2021
@flybayer flybayer deleted the blitz.config.ts branch April 29, 2021 19:32
@andreasasprou
Copy link
Contributor

Can this be disabled by default for non .ts files?

esbuild does not support features that need a type system, which are required for libraries like Typegoose.

@flybayer
Copy link
Member Author

@andreasasprou so blitz.config.js is failing for you because emitDecoratorMetadata is in tsconfig even though blitz.config.js isn't importing any typescript? 🤔

@andreasasprou
Copy link
Contributor

andreasasprou commented May 10, 2021

@flybayer

// blitz.config.js

/* eslint-disable @typescript-eslint/no-var-requires */
require('ts-node').register({ compilerOptions: { module: 'commonjs' } });
require('tsconfig-paths/register');
const { sessionMiddleware } = require('./session-middleware'); // TS file that creates a Typegoose model

const APP_BASE_PATH = process.env.APP_BASE_PATH || '/schedule';
const sentryConfig = require('./sentry.config');

module.exports = {
  basePath: APP_BASE_PATH,
  middleware: [...sessionMiddleware],
// ... etc

@sebastianhoitz
Copy link

@flybayer after upgrading to the new blitz.config.ts it looks like next/image has problems with custom registered domains. It complains they are not added to the config. Did some mapping get lost?

@flybayer
Copy link
Member Author

@sebastianhoitz hmm, that's not expected. Can you open an issue?

@itsdillon itsdillon changed the title Add support for blitz.config.ts [legacy-framework] Add support for blitz.config.ts Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for blitz.config.ts
4 participants