Skip to content

import TaggedTemplateExpression should generate indirect call #17390

@underfin

Description

@underfin

Bug report

What is the current behavior?

The input code

import a from "a"
a();
a``;

The output code

/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! a */ "./a.js");

(0, _a__WEBPACK_IMPORTED_MODULE_0__["default"])()
_a__WEBPACK_IMPORTED_MODULE_0__["default"]`` // here should be indirect call

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

The expected output

/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! a */ "a.js");

(0, _a__WEBPACK_IMPORTED_MODULE_0__["default"])()
(0, _a__WEBPACK_IMPORTED_MODULE_0__["default"])`` // here should be indirect call

Here has babel playground output. https://babeljs.io/repl#?browsers=&build=&builtIns=usage&corejs=3.21&spec=false&loose=false&code_lz=JYWwDg9gTgLgBAEzgMyhEcBEA6A9AQwCMBjTAKDIQAoBKAbgoQAMmg&debug=false&forceAllTransforms=true&modules=false&shippedProposals=true&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=&prettier=false&targets=&version=7.21.8&externalPlugins=%40babel%2Fplugin-transform-modules-commonjs%407.20.11%2C%40babel%2Fplugin-transform-function-name%407.18.9&assumptions=%7B%7D

Other relevant information:
webpack version:
Node.js version:
Operating System:
Additional tools:

Metadata

Metadata

Assignees

No one assigned

    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