-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Include files coming from engines #21
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yeah, we need a way to add plugin paths to the node load path, just like asset pipeline does it. Not quite sure yet how. But you can see how things are setup to use vendor/node_modules and app/javascript in the config files. |
@guilleiguaran Is it possible to use the erb loader on the webpack config? Because if so, we could scan all the plugins for a specific directory to add to webpack's load path and just insert it it directly. |
It seems like we'd want to set |
Would a PR like this be helpful? webpack/webpack@master...jcoyne:resolve-modules-directories |
One of the main issues, from my point of view, is how to handle npm dependencies when extracting JavaScript into engines. Just adding engine paths to the load path won't ensure dependencies are installed. Including engine |
I am working on https://github.com/renchap/webpacker-react and this is my biggest issue at the moment. |
I'm also having this issue! It should be possible to depend on a package.json from the |
🤓😂... gem the same way we do with gemspecs, right? |
Well, yes, but that would leave Yarn with dependency choices already made by Bundler, which in some cases might not be optimal. In particular, to really get to the most up to date versions, users might have to first |
Wondering if there is any updates to this issue. We're currently facing this particular issue and is trying to find out if there are any viable solutions |
I don't think we have a good path for doing this given that such inclusion wouldn't be able to resolve any dependencies. I don't see a way out of having NPM packages for the plugins. That's how we've gone with Action Cable and Active Storage for now. I'm closing this lest someone else comes up with an alternative idea alongside a proof-of-concept PR that deals with the dependency issue. |
PR rails#21 removed pnp-webpack-plugin as a dev dependency but did not remove it from the peer dependency list.
Will JS files coming from engines be available to be required in
pack
?My use case is a library that's composed by many pluggable engines, some of them having complex react components I'm currently building with webpack. I'd like to somehow be able to create a single compiled file in the end at the application level.
One solution would be to add a
bundle.js
file for each engine and version control it into the repo, but then I'm duplicating dependencies - react, for example, as well as any other one.In my scenario, the ideal solution is to have a single entry point in my application that requires files from engines, the same way they would be required if they were npm packages.
So, in my
application.js
file, I'd like to have:Thanks for making the effort to integrate webpack into rails!
The text was updated successfully, but these errors were encountered: