Merge pull request #40 from codex/turbo-env-inputs
fix(turbo): hash local env inputs
This commit is contained in:
commit
021f2cf20e
2 changed files with 17 additions and 0 deletions
|
|
@ -74,6 +74,21 @@ describe("workspace boundaries", () => {
|
|||
);
|
||||
});
|
||||
|
||||
test("accounts for local env files in cacheable Vite and Storybook task hashes", () => {
|
||||
const turboConfig = JSON.parse(
|
||||
readFileSync(join(root, "turbo.json"), "utf8"),
|
||||
) as {
|
||||
tasks?: Record<string, { inputs?: string[] }>;
|
||||
};
|
||||
|
||||
for (const taskName of ["build", "build-storybook"]) {
|
||||
expect(turboConfig.tasks?.[taskName]?.inputs).toEqual([
|
||||
"$TURBO_DEFAULT$",
|
||||
".env*",
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
test("keeps the website app and reusable UI library as separate packages", () => {
|
||||
const webPackage = JSON.parse(
|
||||
readFileSync(join(root, "apps/web/package.json"), "utf8"),
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
||||
"outputs": ["dist/**", "build/**"],
|
||||
"env": ["NODE_ENV", "VITE_*"]
|
||||
},
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
},
|
||||
"build-storybook": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
||||
"outputs": ["storybook-static/**"],
|
||||
"env": ["NODE_ENV", "STORYBOOK_*", "VITE_*"]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue