How to use the tsconfig.readFileSync function in tsconfig

To help you get started, we’ve selected a few tsconfig 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 blakeembrey / typescript-simple-loader / src / typescript-simple-loader.ts View on Github external
function readConfig (filename: string, loader: WebPackLoader, TS: typeof ts) {
  const config = filename ? tsconfig.readFileSync(filename) : {
    files: [],
    compilerOptions: {}
  }

  // Merge all possible compiler options together.
  config.compilerOptions = extend({
    target: 'es5',
    module: 'commonjs'
  }, config.compilerOptions, {
    sourceMap: loader.sourceMap,
    inlineSourceMap: false,
    inlineSources: false,
    declaration: false
  })

  return TS.parseConfigFile(config, TS.sys, filename)
github GerkinDev / vuejs-datatable / rollup.config.js View on Github external
import commonjs from 'rollup-plugin-commonjs';
import license from 'rollup-plugin-license';
import visualizer from 'rollup-plugin-visualizer';
import typescript from 'rollup-plugin-typescript2';
import vueTemplateCompiler from 'rollup-plugin-vue-template-compiler';
import replace from 'rollup-plugin-replace';
import json from 'rollup-plugin-json';

import { isString } from 'util';
import moment from 'moment';
import _ from 'lodash';
import { readFileSync } from 'tsconfig';

// eslint-disable-next-line no-undef
const pkg = require( './package.json' );
const tsconfig = readFileSync( './tsconfig.json' );

const env = process.env.BUILD || 'development';
// The module name
const pkgName = pkg.name;
const globalName = 'VuejsDatatable';
const allContributors = [ pkg.author ].concat( pkg.contributors );
const userToString = p => {
	if ( isString( p ) ){
		return p;
	}
	return p.name + ( p.email ? `<${  p.email  }>` : '' ) + ( p.url ? ` (${  p.url  })` : '' );
};
const allContributorsString = allContributors.map( userToString ).join( ', ' );
// Plugins used for build
export const getPlugins = (iife, environment) => {
	const tsconfigOverride = {
github TypeStrong / tsify / lib / Tsifier.js View on Github external
log('Using inline tsconfig');
			config = JSON.parse(JSON.stringify(opts.project));
			config.compilerOptions = config.compilerOptions || {};
			extend(config.compilerOptions, opts);
		} else {
			if (fileExists(opts.project)) {
				configFile = opts.project;
			} else {
				configFile = ts.findConfigFile(
					ts.normalizeSlashes(opts.project || bopts.basedir || currentDirectory),
					fileExists
				);
			}
			if (configFile) {
				log('Using tsconfig file at %s', configFile);
				config = tsconfig.readFileSync(configFile);
				config.compilerOptions = config.compilerOptions || {};
				extend(config.compilerOptions, opts);
			} else {
				config = {
					files: [],
					compilerOptions: opts
				};
			}
		}

		// Note that subarg parses command line arrays in its own peculiar way:
		// https://github.com/substack/subarg

		if (opts.exclude) {
			config.exclude = opts.exclude._ || opts.exclude;
		}
github jbaron / cats / src / cats / project.ts View on Github external
private readConfigFile(fileName) {
            try {
                return tsconfig.readFileSync(fileName);
            } catch (err) {
                IDE.console.error(`Error reading config file ${fileName}`);
            }
        }

tsconfig

Resole and parse `tsconfig.json`, replicating to TypeScript's behaviour

MIT
Latest version published 7 years ago

Package Health Score

71 / 100
Full package analysis