Skip to content

Targetting ES2015 modules for current browsers not possible (ts:import "name" -> js:import "./name.js") #21389

Closed
@urbanhop

Description

@urbanhop

I want to emit javascript with ES2015 modules. My tsconfig is

"target": "es2017",
"module": "es2015",
...

Problem: Typescript expects

import { Component, h, render } from "preact";

In my js files I need however

import { Component, h, render } from "./preact.js";

Maybe might origin from partial browser implementations. At least I could not find any way to work with import "preact" in typesript and emitting import "./preact.js" in js.

Is there a way to get the "./name.js" for into emitted import statements?
If not, are there plans to appraoch the problem?

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