First enter the webpack.base.conf.js file
添加var webpack = require("webpack")
Then add it to the following module.exports
plugins: [
new webpack.optimize.CommonsChunkPlugin('common.js'),
new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery"
})
],
Then add "jquery": "^1.8.0" to dependencies in package.json;
Import jquery in main.js
import $ from 'jquery'
Finally, restart the project