Comments (7)
@joerodrig3 @merqlove I was able to use jest without symlinks by setting NODE_PATH
in vendor/package.json:
"scripts": {
"test": "NODE_PATH='./node_modules:../app/javascript' jest"
},
"jest": {
"testPathDirs": [
"../app/javascript"
]
}
After that I just had to create a .babelrc in the root of my project, replicating my webpack plugin setup.
from webpacker.
@schpet Thanks for that! That actually seems a lot better than the symlink solution
from webpacker.
Hi, what is a problem to run bin/yarn
?)
But yes, here easy to mistake, just first time.
Also you can try to run cd vendor; yarn
About tasks:
You can write any scripts you want in the package.json, then run it with YARN or with NPM.
from webpacker.
The concern I have with bin/yarn
is that in some cases, such as deploying to Heroku, it seems like we have to create a yarn.lock
file and package.json
file in the root directory of the app anyway to trick Heroku into installing yarn as a dependency. What benefits are there to organizing those files in vendor if we need to create/symlink them in root to get our app deployed and/or get client specs running? It seems like creating these duplicate files adds unnecessary complexity, but I'd also like to know more about why the choice was made to move these files into vendor!
As 3rd party packages, I can understand why node_modules
would be put in vendor, but it seems odd to me that package.json
and yarn.lock
would be put in there as well. I think of them as config files that you typically expect access to on the root level, similar to Gemfile
and Gemfile.lock
from webpacker.
package.json
must be at the same level, as modules folder. So if we have it at vendor level, then it's modules folder will be in vendor too.
But yes, for example in Phoenix framework node_modules
, package.json sitting at the root level. And it just works.
About symlinks, yep it works like workaround, but better is avoid symlinks.
from webpacker.
from webpacker.
@schpet same here, also we can use Makefile :)
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.