npm.io
21.0.49 • Published 2 weeks agoCLI

incremental-compiler

Licence
MIT
Version
21.0.49
Deps
3
Size
624 kB
Vulns
0
Weekly
0
Stars
1

INCREMENTAL COMPILER

A library for any kind of incremental compilers and file watchers, based on @parcel/watcher and chokidar.

API

  1. Incremental Compiler class "IncCompiler"
import { BaseClientCompiler,  BaseClientCompilerOptions } from 'incremental-compiler/src';

export abstract class BaseCompilerForProject<
  ADDITIONAL_DATA = any,
  PROJECT extends BaseProject = BaseProject,
> extends BaseClientCompiler<ADDITIONAL_DATA> {
  
  constructor(
    public project: PROJECT,
    options: BaseClientCompilerOptions,
  ) {
    super();    
    this.initOptions(options);    
  }
}
  1. Incremental watcher object "incrementalWatcher"
import { incrementalWatcher } from 'incremental-compiler/src';
const watcher = await incrementalWatcher(
  [
    this.project.pathFor(`environments/**/*.ts`),
    this.project.pathFor(`env.ts`),
  ],
  {
    name: 'Environment Config Watcher',
    ignoreInitial: true,
    followSymlinks: false,
  },
);
watcher.on('all', async (event, filePath) => {
  onChange();
});

Folders ALWAYS ignored

  • node_modules/
  • .git/