V
V
Vasily2019-06-11 05:00:12
JavaScript
Vasily, 2019-06-11 05:00:12

What is the difference and how to properly include jquery in Webpack?

What is the difference and how to properly include jquery in Webpack?
1. Option in index.js file 2. Second option in webpack.config.js file
import $ from 'jquery';

new webpack.ProvidePlugin({
    $: "jquery",
    jQuery: "jquery"
}),

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Medvedev, 2019-06-11
@balamyt92

1. Connect qjuery where you need it (including globally if you want)
2. Automatically import it everywhere without explicit import.
right as you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question