Skip to content

[Encore] Document exposing global variables #8071

Closed
@weaverryan

Description

@weaverryan

In many cases, you may need to do this:

const $ = require('jquery');
window.$ = window.jQuery = $;

so that you can use $ or jQuery outside of a webpack file (e.g. because you have some JS in a template). We need to document this in the "legacy" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    front-endhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions