diff --git a/pkg/universe.dagger.io/examples/todoapp/netlify.cue b/pkg/universe.dagger.io/examples/todoapp/netlify.cue index c60573c9..3e764954 100644 --- a/pkg/universe.dagger.io/examples/todoapp/netlify.cue +++ b/pkg/universe.dagger.io/examples/todoapp/netlify.cue @@ -8,6 +8,15 @@ import ( "universe.dagger.io/netlify" ) +nodeModulesMount: "/src/node_modules": dagger.#Mount & { + dest: "/src/node_modules" + type: "cache" + contents: dagger.#CacheDir & { + id: "todoapp-modules-cache" + } + +} + dagger.#Plan & { client: { filesystem: { @@ -46,12 +55,15 @@ dagger.#Plan & { // install yarn dependencies bash.#Run & { workdir: "/src" - mounts: "/cache/yarn": dagger.#Mount & { - dest: "/cache/yarn" - type: "cache" - contents: dagger.#CacheDir & { - id: "todoapp-yarn-cache" + mounts: { + "/cache/yarn": dagger.#Mount & { + dest: "/cache/yarn" + type: "cache" + contents: dagger.#CacheDir & { + id: "todoapp-yarn-cache" + } } + nodeModulesMount } script: contents: #""" yarn config set cache-folder /cache/yarn @@ -64,6 +76,7 @@ dagger.#Plan & { test: bash.#Run & { input: deps.output workdir: "/src" + mounts: nodeModulesMount script: contents: #""" yarn run test """# @@ -72,6 +85,7 @@ dagger.#Plan & { build: { run: bash.#Run & { input: test.output + mounts: nodeModulesMount workdir: "/src" script: contents: #""" yarn run build