Since the jQuery version for CDN is likely to be cached. Is there a way to enable the CDN version in webpack as opposed to the local npm version.
What is the best way to enable jQuery in Webpack if it is not loaded on the page?
This seems to have been discussed earlier, see https://github.com/webpack/webpack/issues/150 . The answer was:
webpack is a module that is not a javascript loader. These are package files from a local disk and do not download files from the Internet (except for their own pieces).Use javascript loader i.e. e. script.jsvar $script = require("scriptjs"); $script("//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js", function() { // ... });
webpack is a module that is not a javascript loader. These are package files from a local disk and do not download files from the Internet (except for their own pieces).
Use javascript loader i.e. e. script.js
var $script = require("scriptjs"); $script("//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js", function() { // ... });