Skip to content

import statements are transpiled even if output is set to ES6 #5110

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.

This is probably bug in 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

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions