简体   繁体   中英

Include external library in webpack

What is the syntax for including libraries in the bundle? What I found in "LIBRARY AND EXTERNALS" for the documentation is this:

  • depends on "jquery", but jquery should not be included in the bundle

What do I need to do if i want to do this instead:

  • depends on "jquery", and jquery should be included in the bundle.

You can include it using Provideplugin

new webpack.ProvidePlugin({
    $: "jquery",
    jQuery: "jquery",
    "window.jQuery": "jquery"
}),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM