Skip to content

Instantly share code, notes, and snippets.

@AviVahl
AviVahl / webpack.config.js
Last active August 29, 2019 12:34
TypeScript transformer to remove .js from import and export statements
// https://github.com/Microsoft/TypeScript/issues/16577#issuecomment-343699395
const path = require('path');
const ts = require('typescript');
const { isImportDeclaration, isExportDeclaration, isStringLiteral } = require('tsutils/typeguard/node');
function getCustomTransformers() {
return { before: [stripJsExt] }
function stripJsExt(context) {