How to introduce jquery into vue webpack?
淡淡烟草味2017-05-19 10:27:43
Just introduce cdn directly into index.html. No need to go to such trouble.
習慣沉默2017-05-19 10:27:43
npm i jquery --save
import $ from jquery
This will put jquery into the final generated bundle
index.html
引入,import $ from 'jquery'
, webpack
的配置项external
里面加上 'jquery': 'jQuery'
He will look for jquery from the overall perspective.
高洛峰2017-05-19 10:27:43
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'