Skip to content

Instantly share code, notes, and snippets.

View agustinvinao's full-sized avatar

Agustin Viñao agustinvinao

View GitHub Profile
@agustinvinao
agustinvinao / resolve-tsconfig-path-to-webpack-alias.js
Created October 2, 2019 21:06 — forked from nerdyman/resolve-tsconfig-path-to-webpack-alias.js
Convert TypeScript tsconfig paths to webpack alias paths
const { resolve } = require('path');
/**
* Resolve tsconfig.json paths to Webpack aliases
* @param {string} tsconfigPath - Path to tsconfig
* @param {string} webpackConfigBasePath - Relative base path from tsconfig to Webpack config to create absolute aliases
* @return {object} - Webpack alias config
*/
function resolveTsconfigPathsToAlias({
tsconfigPath = './tsconfig.json',