Skip to content
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

Fat WebJars Expand node_modules to Wrong Directories #124

Open
jclyons opened this issue Nov 10, 2015 · 1 comment
Open

Fat WebJars Expand node_modules to Wrong Directories #124

jclyons opened this issue Nov 10, 2015 · 1 comment

Comments

@jclyons
Copy link

jclyons commented Nov 10, 2015

I wish to avoid using two parallel package management systems (sbt alongside npm and possibly grunt) so I'm attempting instead to incorporate an sbt plugin that runs webpack into our sbt-web workflow. Unfortunately webpack has ~100 transitive dependencies that take forever for sbt to resolve. My (hopefully temporary) workaround to using the single webpack npm webjar is to build a "fat" webjar containing all transitive dependencies and publish it to my company's S3 repository, so as not to slow down our CI build by several minutes.However, my fat webjar is expanding all of the webjar contents into a single directory in the node_modules directory.

In other words, after the expansion, I'm looking for:

node_modules/webjars/async-each/index.js
node_modules/webjars/async-each/README.md
node_modules/webjars/async-each/package.json
node_modules/webjars/async/lib/async.js
node_modules/webjars/async/package.json
node_modules/webjars/async/LICENSE_async-1.3.0
node_modules/webjars/async/README_async-1.3.0.md
node_modules/webjars/binary-extensions/binary-extensions.json
node_modules/webjars/binary-extensions/package.json
node_modules/webjars/binary-extensions/license_binary
...

and i'm getting:

node_modules/webjars/async-each/index.js
node_modules/webjars/async-each/README.md
node_modules/webjars/async-each/package.json
node_modules/webjars/async-each/lib/async.js
node_modules/webjars/async-each/LICENSE_async-1.3.0
node_modules/webjars/async-each/README_async-1.3.0.md
node_modules/webjars/async-each/binary-extensions.json
node_modules/webjars/async-each/package.json
node_modules/webjars/async-each/license_binary
...

Leaving aside whether this is a good idea or not (I do not plan on using any more than the most basic features of webpack, so upgrading webpack in the future may not even be necessary) - does anyone know why this might be happening? Is it a bug in sbt-web, or something wrong with the structure of my fat webjar?

Any help would be very much appreciated.

@jclyons
Copy link
Author

jclyons commented Nov 10, 2015

I ended up coming to another workaround by expanding the webpack webjar, running npm install, then re-bundling the contents in a new jar. But it seems to me it should be possible to bundle up all the transitive dependencies of webpack as jars within the same jar. So I'm curious to know if there is a way to resolve the above issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant