Skip to content

Is there any way to implement a function similar to ProvidePlugin? #76283

Answered by unu0
Kane-Kuroneko asked this question in Help
Discussion options

You must be logged in to vote

you can create a global util.

Here’s how to do it:

  • Create utils/globals.js
import $ from 'jquery';
import _ from 'lodash';

global.$ = $;
global.jQuery = $;
global._ = _;
  • Then, import this file in the entry point of your app.js.
import '../utils/globals';

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Kane-Kuroneko
Comment options

@unu0
Comment options

Answer selected by Kane-Kuroneko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants