- 安装
npm install jquery
npm install @types/jquery
我使用的版本:
- “jquery”: “3.5.1”,
- “@types/jquery”: “3.3.1”
2.配置
const webpack = require('webpack')
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery"
})
]
}
3.引入
import * from 'jquery'