Comments (9)
Another example showing that we are using the wrong yarn version when building from cache in an npm script.
Here is a test site:
https://app.netlify.com/sites/netlify-lerna-yarn-test/deploys
Build command used there is:
yarn --version && yarn run version
All this does is print the yarn version from terminal and also from inside of an npm/yarn script, and these are the results:
HOWEVER, when clearing cache, you get the intended result:
from build-image.
If they use base
, then our current behavior will work correctly. (once the new image is deployed)
from build-image.
If they manually cd
to another directory, a lot of our automatic Node behavior will not work, such as caching node_modules
.
from build-image.
Indeed. But in a monorepo, you cannot set base if you want to build two or more separate code bases. I am aware it is a heavy lift and that's why I said we're just using this to track demand, not ask for change yet
from build-image.
Can't you use contexts?
from build-image.
How does that help this use case?
my repo has 2 subprojects. Both have individual package.json files. There is no /package.json. My build command is this:
cd project1 && npm install && npm run build && cd ../project2 && npm install && npm run build
Customer wants that to use npm@NPM_VERSION in both places and is unwilling/unable to change the root of the repo to have a package.json specifying it (it's a fine workaround for most, but not for all)
from build-image.
Ah, it was unclear they wanted to run commands in two different folders during the same build. I think the "workaround" you posted is the best solution at the moment.
from build-image.
I was the customer in question. Sorry being late to the discussion. But Chinese New Year is this long.
Here's my story.
At first I had my static site completely build with some Python scripts generating some html files and selected root site name: {my name}.netlify.com
Then I found more usage of this site, such as /blog, /cv etc. each subdirectory built with its own tech stack., say one with webpack+Vue, the other Python+plain html.
Rather than manage a few sites, I prefer an umbrella root site {my name}.netlify.com. So I had to build each sub-directory for deployment with my own script, and leave the index.html in the root directory as a site map.
It seems pretty natural and flexible for me build each subdirectory with different technologies.
from build-image.
We think this is affecting yarn too in monorepos, and are doing some tests to confirm. Reported in customer cases:
- https://app.intercom.io/a/apps/q245f50x/inbox/inbox/unassigned/conversations/18572475790
- https://app.intercom.io/a/apps/q245f50x/inbox/inbox/unassigned/conversations/18991508943
from build-image.
Related Issues (20)
- Customizable Java version HOT 2
- Latest NPM versions throw an error when workspaces are configured HOT 1
- Missing workdir "/opt/build" in build container.
- Change the way how the elm compiler is installed as it is not compatible with arm64 HOT 2
- Why is the Hugo version out of date so much?
- Add Haldo linting to build image dockerfile HOT 1
- Run the docker image size inside CircleCI instead of github actions
- Container-structure-tests fail for arm64 HOT 2
- Create multiarch images and push them to the dockerhub HOT 5
- Cache Playwright browser dependencies HOT 3
- `target` directory for Rust is not stored
- Local build test fails with podman HOT 1
- Builds fail when using `[email protected]` HOT 5
- Same codebase stopped compiling in version 4.13 HOT 4
- Monorepo project cannot found pnpm HOT 2
- Failed to debug netlify locally HOT 1
- Add Support for .NET 7 HOT 6
- `NETLIFY_USE_PNPM: true` environment var not working after v4.15.0 HOT 1
- Show an understandable error when `getBuildInfo` failed
- Not respecting pnpm version specified in packageManager field of package.json HOT 1
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 build-image.