-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dagre and dagre-d3 don't work with webpack #129
Comments
Hey Adam! Do you have an small example / repro steps I can try? |
Here's a test case:
Webpack doesn't like this pattern:
|
@rafales use as alias in resolve in webpack ;) resolve: { |
@Kepro Would you mind being more explicit in how we would use aliases to get rid of these warnings? |
I got dagre to work with webpack by forking dagre and graphlib and modifying the bower.js file so that index.js is "main" and the "lib" folder/index.js aren't ignored. This allows webpack to do the bundling vs browserify. Finally, I used the webpack.ProvidePlugin with { dagre: 'dagre' } so I wouldn't have to "require('dagre')" everywhere it's used. When I get a chance, I'll look into making new dagre-webpack and graphlib-webpack packages. |
dagre-webpack and graphlib-webpack repos are now published to bower |
Getting the exact same error (above from 1/6/2015) with the current versions when trying to use with react-slingshot which uses Webpack 2.x |
Are you using the dagre or dagre-webpack package? |
Sorry just getting back to this now. I've tried bower install of dagre-webpack and graphlib-webpack. A usage example of how to get the demos working would be great, showing how to get a reference for:
If I do: const dagreD3 = require('../../bower_components/dagre-webpack'); Then it has issues resolving graphlib-webpack. |
I've updated the README.md for the dagre-webpack project with instructions. Your code looks correct, but I never tried requiring dagre-webpack directly. I've always used the bower-webpack-plugin. Perhaps the plugin automatically 'requires' graphlib-webpack from dagre-webpack's bower.json's dependencies. Did you follow this documentation? |
Will dagre-d3 package with a version above webpack 4 report an error @ @wolffiex |
Webpack would be handy for packaging dagre-d3, but it looks like there's something in the way that the module structure is put together that is breaking it. When I run webpack on a project that includes dagre-d3, I get the following errors. This appears to be related to the code in the /lib files that is like "if (require)..."
[22:05:12] Version: webpack 1.4.13
Asset Size Chunks Chunk Names
main.bundle.js 913110 0 [emitted] main
WARNING in ./
/dagre-d3/lib/graphlib.js/dagre-d3/lib/graphlib.js 4:4-11Critical dependencies:
4:4-11 require function is used in a way, in which dependencies cannot be statically extracted
@ ./
WARNING in ./
/dagre-d3/lib/lodash.js/dagre-d3/lib/lodash.js 4:4-11Critical dependencies:
4:4-11 require function is used in a way, in which dependencies cannot be statically extracted
@ ./
WARNING in ./
/dagre/lib/graphlib.js/dagre/lib/graphlib.js 4:4-11Critical dependencies:
4:4-11 require function is used in a way, in which dependencies cannot be statically extracted
@ ./
WARNING in ./
/dagre-d3//graphlib/lib/lodash.jsCritical dependencies:
4:4-11 require function is used in a way, in which dependencies cannot be statically extracted
@ ./
/dagre-d3//graphlib/lib/lodash.js 4:4-11WARNING in ./
/dagre/lib/lodash.js/dagre/lib/lodash.js 4:4-11Critical dependencies:
4:4-11 require function is used in a way, in which dependencies cannot be statically extracted
@ ./
WARNING in ./
/dagre//graphlib/lib/lodash.jsCritical dependencies:
4:4-11 require function is used in a way, in which dependencies cannot be statically extracted
@ ./
/dagre//graphlib/lib/lodash.js 4:4-11The text was updated successfully, but these errors were encountered: