Skip to content

Empty exportsΒ #44040

@Vardner

Description

@Vardner

Bug Report

πŸ”Ž Search Terms

prevent empty exports {} Object.defineProperty(exports, "__esModule", { value: true });

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions 3.9.6 and 4.2.4

⏯ Playground Link

Playground link with relevant code, change typescript version between 3.9.4 and 4+

πŸ’» Code

import {ABC} from './abc';
const a = 12;

πŸ™ Actual behavior

image

πŸ™‚ Expected behavior

image

Hello, I have some problems when typescript generates empty exports in each file by itself. I use TS compiler to generate files that will be executed by eval. When eval happens I get an error because of exports.
In typescript config, we have the option "isolatedModules", which could do this part of the functionality.

Anyway, how can I get rid of any kind of exports in complied files? I hope you can help me because these exports force me to call string.replace() before executing the files!

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions