How to use @poppinss/chokidar-ts - 3 common examples

To help you get started, we’ve selected a few @poppinss/chokidar-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github huncwotjs / huncwot / cli / server.js View on Github external
const server = async ({ port }) => {
  const compiler = new TypescriptCompiler(CWD, 'config/server/tsconfig.json', require('typescript/lib/typescript'));
  const { error, config } = compiler.configParser().parse();

  if (error || !config || config.errors.length) {
    return;
  }

  const watcher = compiler.watcher(config);

  let app;

  watcher.on('watcher:ready', async () => {
    // start the HTTP server

    app = await start({ port });
  });
github adonisjs / adonis-cli / src / Services / Compiler.ts View on Github external
private _setupCompiler () {
    const compilerPath = require.resolve('typescript/lib/typescript', { paths: [this.projectRoot] })

    /**
     * Create typescript compiler instance
     */
    this._compiler = new TypescriptCompiler(require(compilerPath), 'tsconfig.json', this.projectRoot)
    this._compiler.use((ts) => iocTransformer(ts, this._rcFile), 'after')

    /**
     * Hold reference to the underlying typescript instance
     */
    this.ts = this._compiler.ts
  }
github adonisjs / assembler / src / Compiler / index.ts View on Github external
import {
  RCFILE_NAME,
  TSCONFIG_FILE_NAME,
  SERVER_ENTRY_FILE,
  DEFAULT_BUILD_DIR,
} from '../../config/paths'

/**
 * Exposes the API to build the AdonisJs project for development or
 * production. The production build has it's own set of node_modules
 */
export class Compiler {
  /**
   * Reference to typescript compiler
   */
  public tsCompiler = new TypescriptCompiler(
    this.appRoot,
    TSCONFIG_FILE_NAME,
    require(resolveFrom(this.appRoot, 'typescript/lib/typescript')),
  )

  /**
   * Reference to HTTP server
   */
  public httpServer: HttpServer | DummyHttpServer

  /**
   * Reference to rc File
   */
  public rcFile = new RcFile(this.appRoot)

  /**

@poppinss/chokidar-ts

File watcher that creates a file watcher after parsing tsconfig.json file

MIT
Latest version published 8 months ago

Package Health Score

64 / 100
Full package analysis

Popular @poppinss/chokidar-ts functions