You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build-and-deploy.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This project uses two runtime modes:
4
4
5
-
- Local development mode: dynamic CDN resolution from `src/cdn.js` with esm.sh as default.
5
+
- Local development mode: dynamic CDN resolution from `src/modules/cdn.js` with esm.sh as default.
6
6
- Production mode: CDN-first build artifacts in `dist`, with `build:esm` as the current preferred deploy build.
7
7
8
8
## Local Development
@@ -45,8 +45,8 @@ npm run build:importmap-mode
45
45
| Mode | Resolver | Import map step | JSPM index needed | Typical use |
46
46
| --- | --- | --- | --- | --- |
47
47
|`importMap`| Import map in `dist/index.html`| Yes | Yes | Default production mode |
48
-
|`esm`|`src/cdn.js` (`esm.sh` primary) | No | No | Stable fallback mode |
49
-
|`jspmGa`|`src/cdn.js` (`ga.jspm.io` primary) | No | No | Direct ga.jspm.io testing |
48
+
|`esm`|`src/modules/cdn.js` (`esm.sh` primary) | No | No | Stable fallback mode |
49
+
|`jspmGa`|`src/modules/cdn.js` (`ga.jspm.io` primary) | No | No | Direct ga.jspm.io testing |
50
50
<!-- prettier-ignore-end -->
51
51
52
52
Mode notes:
@@ -72,7 +72,7 @@ This runs two steps:
72
72
-`sass=1.93.2`
73
73
-`less=4.4.2`
74
74
- Traces generated `dist/prod-imports.js`
75
-
- Import specifiers come from `importMap` entries in `src/cdn.js` (`cdnImportSpecs`)
75
+
- Import specifiers come from `importMap` entries in `src/modules/cdn.js` (`cdnImportSpecs`)
76
76
77
77
Preview the built site locally:
78
78
@@ -99,20 +99,20 @@ Related docs:
99
99
100
100
-`docs/code-mirror.md` for CodeMirror CDN integration rules, fallback behavior, and validation checklist.
101
101
102
-
-`src/cdn.js` is the source of truth for CDN-managed runtime libraries (including fallback candidates). Add/update CDN specs there instead of hardcoding module URLs inside feature modules.
102
+
-`src/modules/cdn.js` is the source of truth for CDN-managed runtime libraries (including fallback candidates). Add/update CDN specs there instead of hardcoding module URLs inside feature modules.
103
103
104
104
- In production, the current preferred deploy mode is ESM resolution (`window.__KNIGHTED_PRIMARY_CDN__ = "esm"`).
105
105
- In `importMap` mode, runtime resolution is import-map first; if a specifier is missing from the generated map, runtime falls back through the CDN
106
-
provider chain configured in `src/cdn.js`.
107
-
- In `esm` and `jspmGa` modes, runtime resolution is handled entirely by the CDN provider chain configured in `src/cdn.js` without an import map.
106
+
provider chain configured in `src/modules/cdn.js`.
107
+
- In `esm` and `jspmGa` modes, runtime resolution is handled entirely by the CDN provider chain configured in `src/modules/cdn.js` without an import map.
108
108
109
109
### Sass Loading Gotchas
110
110
111
111
- Symptom: switching to Sass mode shows `Unable to load Sass compiler for browser usage: Dynamic require of "url" is not supported`.
112
112
- Cause: some `esm.sh` Sass outputs currently include runtime paths that are not browser-safe for this app.
113
-
- Current mitigation: `src/cdn.js` keeps `esm.sh` first, then falls back to `unpkg` for Sass via `sass@1.93.2/sass.default.js?module`.
113
+
- Current mitigation: `src/modules/cdn.js` keeps `esm.sh` first, then falls back to `unpkg` for Sass via `sass@1.93.2/sass.default.js?module`.
114
114
- Important context: this can appear even if the Sass URL has not changed in this repo, because CDN-transformed module output can change upstream.
115
115
- If this regresses again:
116
-
- Verify Sass import candidates in `src/cdn.js`.
116
+
- Verify Sass import candidates in `src/modules/cdn.js`.
117
117
- Reproduce directly in browser devtools with `await import('<candidate-url>')`.
118
118
- Keep at least one known browser-safe fallback provider in the Sass candidate list.
0 commit comments