Since a CDN version of jQuery is very likely to be cached. Is there a way to include the CDN version in webpack as opposed to the local npm version.
What is the best way to include jQuery in Webpack if it's not loaded on the page?
This seems to have been discussed before, see https://github.com/webpack/webpack/issues/150. The response was:
webpack is a module bundler not a javascript loader. It package files from local disk and don't load files from the web (except its own chunks).
Use a javascript loader, i. e. script.js
var $script = require("scriptjs"); $script("//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js", function() { // ... });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With