How to introduce jquery into vue webpack?
Just introduce cdn directly into index.html. No need to go to such trouble.
import $ from 'jquery'首先 cnpm i --save jquery
npm i jquery --save import $ from jquery This will put jquery into the final generated bundle
npm i jquery --save
import $ from jquery
index.html引入,import $ from 'jquery', webpack 的配置项external里面加上 'jquery': 'jQuery' He will look for jquery from the overall perspective.
index.html
import $ from 'jquery'
webpack
external
'jquery': 'jQuery'
wabpack introduces jquery
1.npm i jquery --save (you will still depend on jquery after publishing)2. In the entry file main.js (depending on the entry file you configured), introduce import $ from 'jquery'
Just introduce cdn directly into index.html. No need to go to such trouble.
import $ from 'jquery'
首先 cnpm i --save jquery
npm i jquery --save
import $ from jquery
This will put jquery into the final generated bundleindex.html
引入,import $ from 'jquery'
,webpack
的配置项external
里面加上'jquery': 'jQuery'
He will look for jquery from the overall perspective.wabpack introduces jquery
1.npm i jquery --save (you will still depend on jquery after publishing)
2. In the entry file main.js (depending on the entry file you configured), introduce import $ from 'jquery'