mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-03 19:07:15 +00:00
2a1ee96a4b
* Bundle `@types/node` into `nuxt-ts` distribution * feat(ts): Autogenerated tsconfig.json * fix(examples): Update typescript examples * fix(ts): Add `dist` & `tsconfig.json` to `pakage.json` files * fix: add missing new line at the end of generated `tsconfig.json` * add suffix if needed to `tsconfig.json` types during package build * use `readJSON` over `readJSONSync` * fix indentation in `nuxt-ts/tsconfig.json` * use writeJson instead of writeFile * split `nuxt-ts/src` in 2 functions + rootDir parametr + add tests * add `fs-extra` to dependencies to prevent build warning * JSON everywhere instead of JSON/Json * fix: missing call to generateTsConfigIfMissing * ask confirmation for tsconfig.json generation * improvement: let compilerOptions.module as default * improvements * move from github link to friendly linkable local path * add resolveJsonModule in default config Co-Authored-By: kevinmarrec <kevin@marrec.io> * Move `nuxt-ts` logic to `@nuxt/typescript` * Upgrade to `ts-node@8.0.1`
16 lines
457 B
JavaScript
Executable File
16 lines
457 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
// Globally indicate we are running in ts mode
|
|
process.env.NUXT_TS = 'true'
|
|
|
|
const rootDir = (process.argv[2] && process.argv[2] !== 'dev') ? process.argv[2] : process.cwd()
|
|
|
|
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
|
|
|
|
require('@nuxt/typescript' + suffix).setup(rootDir).then(() => {
|
|
require('@nuxt/cli' + suffix).run()
|
|
}).catch((error) => {
|
|
require('consola').fatal(error)
|
|
process.exit(2)
|
|
})
|