Can you please provide example of usage with custom server framework?
Here you go!
const HTTPS = require('https')
const path = require('path')
const express = require('express')
const consola = require('consola')
const { Nuxt, Builder } = require('nuxt')
const app = express()
const { registerTSNode, getRootdirFromArgv } = require('@nuxt/typescript-runtime/lib')
const rootDir = getRootdirFromArgv()
const tsConfigPath = path.resolve(rootDir, 'tsconfig.json')
registerTSNode(tsConfigPath)
// Import and Set Nuxt.js options
const config = require('../nuxt.config.js')
It took about an hour to solve it. It's taken from @nuxt/typescript-runtime internals and it works fine :)
But let someone from core-team approves this solution
@krystian50 Thanks 馃檹
Here you go!
const HTTPS = require('https') const path = require('path') const express = require('express') const consola = require('consola') const { Nuxt, Builder } = require('nuxt') const app = express() const { registerTSNode, getRootdirFromArgv } = require('@nuxt/typescript-runtime/lib') const rootDir = getRootdirFromArgv() const tsConfigPath = path.resolve(rootDir, 'tsconfig.json') registerTSNode(tsConfigPath) // Import and Set Nuxt.js options const config = require('../nuxt.config.js')It took about an hour to solve it. It's taken from
@nuxt/typescript-runtimeinternals and it works fine :)But let someone from core-team approves this solution
Thank you for sharing. @kevinmarrec, can we provide some kind of official way of doing it, since nuxt (js) api supports it? Many people would be happy to use custom framework instead of connect, including me 馃槉
@krystian50 https://github.com/nuxt/typescript/issues/193#issuecomment-554298475 it seems to be using an old version of @nuxt/typescript-runtime.
Most helpful comment
Here you go!
It took about an hour to solve it. It's taken from
@nuxt/typescript-runtimeinternals and it works fine :)But let someone from core-team approves this solution