Full cache miss when editing a single file for a local project, pnpm, turbo, esbuild #9179
-
SummaryI have probably explained terribly in the title, so here it goes. I have a local project which allows me to build and bundle our implementation of the Tiptap editor. In the root of the project I pull in all my dependencies. I have a packages:
- 'packages/*'This is my {
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"inputs": ["src/**/*", "package.json", "esbuild.config.js"],
"outputs": ["dist/**"]
}
}
}This is my "build": "turbo run build && node esbuild.config.js",This is my Within the root directory I also have a Each of those has a {
"name": "@me/tiptap-extension-video",
"version": "1.0.0",
"description": "video extension for tiptap",
"private": true,
"packageManager": "pnpm@9.10.0",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rm -rf dist",
"build": "node esbuild.config.js"
},
"devDependencies": {
"esbuild": "^0.23.1",
"typescript": "^5.5.3"
},
"peerDependencies": {
"@tiptap/core": "^2.0.0",
"@tiptap/pm": "^2.0.0",
"@me/tiptap-extension-resize-utilities": "workspace:*"
}
}And its own esbuild config: const esbuild = require('esbuild')
const baseConfig = {
entryPoints: ['src/index.ts'],
bundle: true,
sourcemap: true,
minify: process.env.NODE_ENV === 'production',
target: ['es2020'],
external: ['@tiptap/core', '@tiptap/pm', '@me/tiptap-extension-resize-utilities'],
}
const cjsConfig = {
...baseConfig,
outfile: 'dist/index.cjs.js',
format: 'cjs',
}
const esmConfig = {
...baseConfig,
outfile: 'dist/index.js',
format: 'esm',
}
async function build ()
{
try
{
await Promise.all([
esbuild.build(cjsConfig),
esbuild.build(esmConfig),
])
console.log('Build completed successfully')
}
catch (error)
{
console.error('Build failed:', error)
process.exit(1)
}
}
build()I apologise in advance for how detailed this is but I figured if there was an issue it would be better to get everything out there in one go. Now, everything is working fine. I really enjoy Turbo over Lerna, for example, and even with this issue it seems to be super fast. But the specific issue I'm facing is that if I modify one I subsequent run without changes, as expected, will be fully cached: If I edit one file in one package and build my expectation was it would look something like this: Are my expectations faulty in some way or is there an issue here? Happy to provide any log output (or look for specifics in output) that might help narrow this down. Thank you! Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Does this mean you've installed dependencies into the root If so, then any change to |
Beta Was this translation helpful? Give feedback.
Does this mean you've installed dependencies into the root
package.json? Like:If so, then any change to
@repo/configwill invalidate all packages, since changes to root dependencies affect all packages.