diff --git a/hello-world/frontend/canister.yaml b/hello-world/frontend/canister.yaml index 61fa548..4b72291 100644 --- a/hello-world/frontend/canister.yaml +++ b/hello-world/frontend/canister.yaml @@ -2,28 +2,17 @@ name: frontend -build: - steps: - - type: pre-built - url: https://github.com/dfinity/sdk/raw/89243f2268b6d0ec77d589b7b1b27af931f70edd/src/distributed/assetstorage.wasm.gz - sha256: b312a16c3179cf8384afa852e468c1333b7439d4c5a39f26df69b12320f629f8 - +recipe: + # https://github.com/dfinity/icp-cli-recipes/blob/main/recipes/asset-canister/README.md + type: "@dfinity/asset-canister@v2.1.0" + configuration: + build: # Install the dependencies # Eventually you might want to use `npm ci` to lock your dependencies - - type: script - command: npm install - + - npm install # Generate the bindings from backend.did file in the backend canister # You could choose to run this once manually and checkin the generated code # instead of running it every single time - - type: script - command: npm run generate --prefix app - - - type: script - command: npm run build - -sync: - steps: - - type: assets - dirs: - - app/dist + - npm run generate --prefix app + - npm run build + dir: app/dist diff --git a/static-website/README.md b/static-website/README.md index d6888da..80cc4bd 100644 --- a/static-website/README.md +++ b/static-website/README.md @@ -17,6 +17,7 @@ canisters: type: "@dfinity/asset-canister@" configuration: build: + - npm install - npm run build dir: dist ``` @@ -58,10 +59,6 @@ canisters: ## Run It ```bash -# Install dependencies: -# Vite is required for this example to bundle assets -npm ci - # Start a local network icp network start -d diff --git a/static-website/cargo-generate.toml b/static-website/cargo-generate.toml index 15618db..bbc7d9a 100644 --- a/static-website/cargo-generate.toml +++ b/static-website/cargo-generate.toml @@ -1,3 +1,2 @@ [template] exclude = ["public/logo.png"] - diff --git a/static-website/icp.yaml b/static-website/icp.yaml index d537c59..183a535 100644 --- a/static-website/icp.yaml +++ b/static-website/icp.yaml @@ -6,5 +6,8 @@ canisters: type: "@dfinity/asset-canister@v2.1.0" configuration: build: + # Install the dependencies + # Eventually you might want to use `npm ci` to lock your dependencies + - npm install - npm run build dir: dist