question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Library is not included in webpack bundle

See original GitHub issue

Hello, 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:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cranetmcommented, Mar 27, 2018

oh, God. its simplier than I thought. test: /\.woff|woff2|ttf|eot|svg|png|jpg$/, and d3-svg-legend matches by svg word the right pattern should be /\.(woff|woff2|ttf|eot|svg|png|jpg)$/

0reactions
susielucommented, Mar 31, 2018

Oh wow surprised this didn’t come up before, good catch.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found