GithubHelp home page GithubHelp logo

Comments (11)

dhh avatar dhh commented on May 5, 2024 13

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.

from webpacker.

mengqing avatar mengqing commented on May 5, 2024 13

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

from webpacker.

tf avatar tf commented on May 5, 2024 6

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 package.json files in the main app's yarn install can lead to problems with conflicts between bundler's and yarn's dependency resolution.

from webpacker.

dhh avatar dhh commented on May 5, 2024

@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.

from webpacker.

jcoyne avatar jcoyne commented on May 5, 2024

It seems like we'd want to set resolve.modulesDirectories, but I don't see a CLI option for setting that.

from webpacker.

jcoyne avatar jcoyne commented on May 5, 2024

Would a PR like this be helpful? webpack/webpack@master...jcoyne:resolve-modules-directories

from webpacker.

renchap avatar renchap commented on May 5, 2024

I am working on https://github.com/renchap/webpacker-react and this is my biggest issue at the moment.
Currently (push to the repo coming soon) I created a webpacker-react NPM package and you need to manually include it into your package.json in addition to adding the gem to your project, and it would be great to be able to avoid this step.

from webpacker.

josepjaume avatar josepjaume commented on May 5, 2024

I'm also having this issue! It should be possible to depend on a package.json from the

from webpacker.

josepjaume avatar josepjaume commented on May 5, 2024

🤓😂... gem the same way we do with gemspecs, right?

from webpacker.

tf avatar tf commented on May 5, 2024

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 bundle update and then yarn update. We would probably also need to apply some magic to the application's package.json to insert the (transitive) engine dependencies. I'm not sure all of this will make for a very intuitive workflow.

from webpacker.

dhh avatar dhh commented on May 5, 2024

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.

from webpacker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.