引入了外部js
index.html
<script
src="https://code.jquery.com/jquery-3.1.0.js"
integrity="sha256-slogkvB1K3VOkzAI8QITxV3VzpOnkeNVsKvtkYLMjfk="
crossorigin="anonymous">
</script>
js中
import $ from 'jquery'
这时候会报jquery undefined之类的
在webpack配置文件中
module.exports = {
entry: [],
externals: {
jquery: 'jQuery'
},
output: {...}
}