先安装依赖vue
npm install jquery
在src同级目录下新建一个vue.config.js
文件jquery
粘贴下面内容到这个文件中便可webpack
const webpack = require('webpack') module.exports = { //引入jquery chainWebpack: config => { config.plugin('provide').use(webpack.ProvidePlugin, [{ $: 'jquery', jquery: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery' }]) } }