Skip to content

Feature/bug - Need reference to AMD module object #13591

@ORESoftware

Description

@ORESoftware

On version 2.1.0 - transpiling to AMD, in the browser I have this:

import { createStore } from 'redux'

var store = createStore(() => {})

const x = module.id;

which transpiles to:

define(["require", "exports", "redux"], function (require, exports, redux_1) {
    "use strict";
    var store = redux_1.createStore(function () { });
    var x = module.id;
});

however, I am looking to grab a hold of the module object from a RequireJS module. So what I am looking for is something like this instead:

define(["require", "exports", "module", "redux"], function (require, exports, module, redux_1) {
    "use strict";
    var store = redux_1.createStore(function () { });
    var x = module.id;
});

am I doing something wrong? Is this possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions