Library is not included in webpack bundle
See original GitHub issueHello,
unfortunately cannot include d3-legend into my project. I am using npm, typescript and webpack(with pretty default configurations).
So, when I import d3-legend via import * as legend from 'd3-svg-legend';, webpack copies lib-file into assets folder instead of including it into the main bundle. And when I log that legend variable, it contains only string-path to file in assets folder, like ‘/assets/build/assets/f7cef8a85c1c33ef2fdaf592dca074c1.js’.
P.S. I am using a lot of libraries, including d3 itself, and all they import fine.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Authoring Libraries | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >How to bundle a library with webpack? - Stack Overflow
Is there I way to bundle everything into a UMD module to publish it? I tried using multiple entry points, however I cannot...
Read more >Bundling your library with Webpack - tobias-barth.net
In my library-starter example code I use React's JSX. As it is configured now, Webpack will refuse to bundle it because it encounters...
Read more >[Webpack 5] Modules from internal library cannot be loaded ...
It seems like the dist bundle file is never "expanded" in __webpack_modules__ . If you look at the image you'll see that the...
Read more >How webpack decides what to bundle - Jakob Lind
Your bundle will not include the full react-router-dom library, but only a subset of it. That's awesome because it makes the bundle size...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

oh, God. its simplier than I thought.
test: /\.woff|woff2|ttf|eot|svg|png|jpg$/,andd3-svg-legendmatches bysvgword the right pattern should be/\.(woff|woff2|ttf|eot|svg|png|jpg)$/Oh wow surprised this didn’t come up before, good catch.