Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webpack externals with wildcard

Tags:

webpack

How can I instruct webpack to exlude all d3-modules?

// does not work
externals: {
        "d3-*": "d3"
    }

So if app imports d3-submodule, then webpack should not include this submodule because I have already included d3.js.

like image 683
nimo23 Avatar asked Nov 25 '25 12:11

nimo23


1 Answers

You should be able to use regular expressions (see https://webpack.js.org/configuration/externals/#regex).

// This might work
externals: /^d3-.*/
like image 117
bjarkig82 Avatar answered Nov 28 '25 16:11

bjarkig82



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!