Skip to content

Commit f09d2e2

Browse files
authored
Merge pull request #17 from dfinity/marc0olo/recipe-build-improvements
chore: improve recipe build configs for static-website and hello-world
2 parents 02fa72f + 3df7982 commit f09d2e2

4 files changed

Lines changed: 13 additions & 25 deletions

File tree

hello-world/frontend/canister.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,17 @@
22

33
name: frontend
44

5-
build:
6-
steps:
7-
- type: pre-built
8-
url: https://github.com/dfinity/sdk/raw/89243f2268b6d0ec77d589b7b1b27af931f70edd/src/distributed/assetstorage.wasm.gz
9-
sha256: b312a16c3179cf8384afa852e468c1333b7439d4c5a39f26df69b12320f629f8
10-
5+
recipe:
6+
# https://github.com/dfinity/icp-cli-recipes/blob/main/recipes/asset-canister/README.md
7+
type: "@dfinity/asset-canister@v2.1.0"
8+
configuration:
9+
build:
1110
# Install the dependencies
1211
# Eventually you might want to use `npm ci` to lock your dependencies
13-
- type: script
14-
command: npm install
15-
12+
- npm install
1613
# Generate the bindings from backend.did file in the backend canister
1714
# You could choose to run this once manually and checkin the generated code
1815
# instead of running it every single time
19-
- type: script
20-
command: npm run generate --prefix app
21-
22-
- type: script
23-
command: npm run build
24-
25-
sync:
26-
steps:
27-
- type: assets
28-
dirs:
29-
- app/dist
16+
- npm run generate --prefix app
17+
- npm run build
18+
dir: app/dist

static-website/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ canisters:
1717
type: "@dfinity/asset-canister@<version>"
1818
configuration:
1919
build:
20+
- npm install
2021
- npm run build
2122
dir: dist
2223
```
@@ -58,10 +59,6 @@ canisters:
5859
## Run It
5960

6061
```bash
61-
# Install dependencies:
62-
# Vite is required for this example to bundle assets
63-
npm ci
64-
6562
# Start a local network
6663
icp network start -d
6764

static-website/cargo-generate.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
[template]
22
exclude = ["public/logo.png"]
3-

static-website/icp.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ canisters:
66
type: "@dfinity/asset-canister@v2.1.0"
77
configuration:
88
build:
9+
# Install the dependencies
10+
# Eventually you might want to use `npm ci` to lock your dependencies
11+
- npm install
912
- npm run build
1013
dir: dist

0 commit comments

Comments
 (0)