Simple question about jquery and webpack,
I have downloaded jquery.js
then added into app.js
these lines
import "./jquery";
import "./bootstrap";
My webpack.config
entry line
entry: "./src/app.js"
So files tree is:
./webpack.config.js
./src/app.js
./src/jquery.js
./src/bootstrap.js
How can I simply add jquery
to define in webpack.config
with this file tree while it is functional?
I tried adding
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
at the end of the webpack.config
but it gives Module not found: Error: Can't resolve 'jquery'
.
What is the solution for using js files manually with webpack for bundling without an error?
See Question&Answers more detail:os