Comments (11)
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.
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.
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.
@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.
It seems like we'd want to set resolve.modulesDirectories
, but I don't see a CLI option for setting that.
from webpacker.
Would a PR like this be helpful? webpack/webpack@master...jcoyne:resolve-modules-directories
from webpacker.
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.
I'm also having this issue! It should be possible to depend on a package.json from the
from webpacker.
🤓😂... gem the same way we do with gemspecs, right?
from webpacker.
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.
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)
- Webpacker 6 Disable Babel HOT 1
- Webpacker compilation takes more than 1.5 hours HOT 11
- How do I allow a package in node_modules to be processed by babel? HOT 1
- Remove addition of node_modules to Rails.application.config.assets.paths HOT 1
- V6 Status HOT 3
- Raise an error when javascript_pack_tag or stylesheet_pack_tag are called more than once HOT 1
- Regular Expression Denial of Service in postcss HOT 2
- Intermittent Webpacker.dev_server.running? behavior HOT 2
- Host for assets from a webpacker configuration using custom domains not being resolved HOT 2
- Cherry-pick "Nothing to do" logging update onto `5.x` HOT 1
- Rails 6 WebPacker is not calling JQuery inside views HOT 1
- Security Vulnerability in [email protected] HOT 2
- currently no loaders are configured to process this file HOT 1
- Incompatibility with Ruby 3.2.0 HOT 2
- Confusing gem description on RubyGems HOT 1
- Npm package for 5.4.4 was not released HOT 2
- class variable @@local_levels of ActiveSupport::Logger is overtaken by Logger HOT 2
- Trying to deploy but assets assets:precompile fail
- Security Vulnerability for postcss
- Postcss Security Vulnerability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpacker.