Closed justincorrigible closed 7 years ago
Are you referring to using the webpack.ProvidePlugin ?
If so then webpack actually automatically includes the package that you're providing into the generated bundles. This means there's no need to separately include the provided asset...
Or, if you mean using the externals section of the webpack config, then yes, you can set an external, and then also include the script for that external asset via html-webpack-include-assets-plugin
@hallaathrad Also, if you're interested, I built a separate plugin that uses html-webpack-include-assets-plugin
to do this behind the scenes: html-webpack-externals-plugin
.
@mmiller42 I've managed to get it working with the plugin @jharris4 suggested; yet I'm willing to give yours a try if only to reduce boilerplate. Lemme get back to you later, when I get back to this. :+1:
Beforehand, I am somewhat ignorant in this regard, but is it possible to add one of the included assets as an external? Say if you load jQuery through this plugin, could I refer to it in the same webpack config as an external, to expose it as a global variable, or even use it in my app?
Not sure if what I'm asking even makes sense technically.