Skip to content

es6 imports translated to modules even when output set to es6  #643

Closed
@tomitrescak

Description

@tomitrescak

Hi

Up until latest update my es6 imports were left the way they was when transpilig to es6.
From the latest update now they are transpiled to the module representation.

For example:

import TabControl from "../../components/tabs/tab_control";

is transpiled to

var tab_control_1 = require("../../components/tabs/tab_control");

The worst part is, that it breaks the TSX transpilation as for example

  <TabControl tabs={this.state.tabs}>
            {
              this.props.validations.map((validation: BoardValidation, index: number) => {
                return <BoardValidationView key={index} />
              })
            }
</TabControl>

is transpiled to:

<tab_control_1.default tabs={this.state.tabs}>
            {this.props.validations.map((validation, index) => {
            return <BoardValidationView key={index} />;
        })}
          </TabControl>

Note how the closing tag is not transpiled.

I am sure that this is bug in Microsoft transpilation, but can the transpilation of import statements be disabled? Up until today all was working well ... now none of my TS project runs ;((

For completeness, here is my tsconfig

{
    "compilerOptions": {
        "target": "es6",
        "declaration": false,
        "noImplicitAny": true,
        "removeComments": false,
        "noLib": false,
        "preserveConstEnums": true,
        "noEmitHelpers": true,
        "suppressImplicitAnyIndexErrors": true,
        "watch": true,
        "outDir": "../dist",
        "jsx": "preserve"
    },
...
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions