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
- Add standalone 'watch' command for continuous compilation
- Update all documentation for CLI command parity
- Update templates with TypeScript/SCSS, CDN, and areas sections
- Remove preview designation from version
> **Note:** The CLI is **not required** for production builds. Production bundling is handled automatically by MSBuild targets during `dotnet publish -c Release`. However, the CLI is useful for:
52
-
> - Development: Compile TypeScript/SCSS on-the-fly with `dotnet frontend dev`
52
+
> - Development: Compile TypeScript/SCSS with `dotnet frontend dev` or `dotnet frontend watch`
53
53
> - Standalone builds: Build bundles without running MSBuild with `dotnet frontend build` (useful for CDN workflows)
54
54
> - Diagnostics: Validate configuration and assets with `dotnet frontend check`
55
55
@@ -111,7 +111,7 @@ Add helpers to your `_Layout.cshtml` or equivalent:
111
111
dotnet frontend dev
112
112
113
113
# Or watch for changes (recommended)
114
-
dotnet frontend dev --watch
114
+
dotnet frontend watch
115
115
```
116
116
Then run your app with `dotnet run` or `dotnet watch run`.
117
117
@@ -330,14 +330,14 @@ global:
330
330
331
331
### Development Workflow
332
332
333
-
For development, use the `dev` command to compile TypeScript and SCSS files:
333
+
For development, use the `dev` or `watch` command to compile TypeScript and SCSS files:
334
334
335
335
```bash
336
336
# One-time compilation
337
337
dotnet frontend dev
338
338
339
339
# Watch mode (recommended)
340
-
dotnet frontend dev --watch
340
+
dotnet frontend watch
341
341
```
342
342
343
343
This compiles your source files to `.js` and `.css` next to the originals, which are then served by the development helpers with cache-busting.
The `dev` command compiles TypeScript and SCSS files to JavaScript and CSS for development. This enables you to use TypeScript and SCSS without running production builds during development.
451
+
The `dev` command compiles TypeScript and SCSS files to JavaScript and CSS for development (one-time).
449
452
450
453
```bash
451
454
# Compile all TypeScript/SCSS files from frontend.config.yaml
452
455
dotnet frontend dev
453
456
454
-
# Watch for changes and recompile automatically
455
-
dotnet frontend dev --watch
456
-
457
457
# Show compilation details
458
458
dotnet frontend dev --verbose
459
459
```
@@ -465,10 +465,18 @@ dotnet frontend dev --verbose
465
465
- Output files are placed next to source files (e.g., `site.ts` → `site.js`)
466
466
- Source maps are generated for debugging
467
467
468
-
**Watch mode:**
468
+
### Watch Mode (`watch`)
469
+
470
+
The `watch` command compiles and then monitors for changes:
471
+
469
472
```bash
470
-
dotnet frontend dev --watch
473
+
# Start watching for changes
474
+
dotnet frontend watch
475
+
476
+
# With detailed output
477
+
dotnet frontend watch --verbose
471
478
```
479
+
472
480
- Monitors your `jsRoot` and `cssRoot` directories for changes
473
481
- Automatically recompiles when `.ts`, `.tsx`, `.scss`, or `.sass` files change
474
482
- Shows compilation results in real-time
@@ -480,12 +488,12 @@ dotnet frontend dev --watch
480
488
dotnet watch run
481
489
482
490
# Terminal 2: Watch and compile frontend assets
483
-
dotnet frontend dev --watch
491
+
dotnet frontend watch
484
492
```
485
493
486
494
This gives you:
487
495
- Hot reload for C# code (via `dotnet watch`)
488
-
- Auto-compilation for TypeScript/SCSS (via `frontend dev --watch`)
496
+
- Auto-compilation for TypeScript/SCSS (via `frontend watch`)
Copy file name to clipboardExpand all lines: SPEC.md
+39-6Lines changed: 39 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,10 @@ A small, .NET-native helper tool named **MvcFrontendKit** that:
22
22
- Adds **components** as reusable JS/CSS units for partials, with runtime deduplication.
23
23
- Plays nicely with `dotnet run` / `dotnet watch` without introducing HMR or SPA-level complexity.
24
24
25
-
Out of scope (for this version):
25
+
Out of scope:
26
26
27
27
- Full SPA-style integration for Vue/React (dev servers, HMR).
28
-
-CDN base URL for manifest URLs (implemented), SRI hashes and advanced incremental build caching (reserved as future extensions).
28
+
- SRI hashes and advanced incremental build caching (reserved as future extensions).
29
29
30
30
### 1.1 Preprocessor Support (TypeScript & SCSS)
31
31
@@ -105,8 +105,11 @@ This is a zero-config feature:
105
105
- Subsequent calls to `FrontendInclude("...")` for the same component emit nothing.
106
106
107
107
5.**CLI helper** (optional but recommended)
108
-
-`dotnet frontend init`
109
-
-`dotnet frontend check [--verbose]`
108
+
-`dotnet frontend init` — scaffold configuration
109
+
-`dotnet frontend check [--verbose]` — validate config and assets
110
+
-`dotnet frontend dev [--verbose]` — compile TS/SCSS for development (one-time)
111
+
-`dotnet frontend watch [--verbose]` — compile and watch for changes
112
+
-`dotnet frontend build [--dry-run] [--verbose]` — production build (standalone)
110
113
111
114
> **No HMR**
112
115
> This tool does not provide hot module replacement. JS/CSS changes require a normal browser refresh. It is compatible with `dotnet watch` for Razor recompilation, but does not hook into ASP.NET hot reload semantics.
@@ -774,14 +777,41 @@ This helper is optional and intended for development troubleshooting. It can saf
774
777
-`global.js` / `global.css` paths.
775
778
-`views.overrides[*].js` / `css` paths.
776
779
-`components[*].js` / `css` paths.
780
+
-`areas[*].js` / `css` paths.
777
781
- Checks CSS files in bundling scope:
778
782
- Warns or errors on disallowed `../` URLs based on `cssUrlPolicy`.
779
783
- With `--verbose`, additionally:
780
784
- Prints mapping of view keys to Dev assets and Prod bundle keys.
781
785
- Prints component graph (including `depends`) and warns about cycles.
782
-
- May optionally inspect esbuild’s module graph to warn about circular JS imports (while still allowing them).
786
+
- Displays CDN and areas configuration.
787
+
- May optionally inspect esbuild's module graph to warn about circular JS imports (while still allowing them).
783
788
- Optionally warns if any predicted bundle exceeds a configurable size threshold (e.g., 500KB).
784
789
790
+
### 10.3 `dotnet frontend dev [--verbose]`
791
+
792
+
- Compiles TypeScript and SCSS files to JavaScript and CSS for development.
793
+
- Reads `frontend.config.yaml` to find all TypeScript (`.ts`, `.tsx`) and SCSS (`.scss`, `.sass`) files.
794
+
- Compiles TypeScript using esbuild's native TypeScript loader.
795
+
- Compiles SCSS using the bundled Dart Sass compiler.
796
+
- Output files are placed next to source files (e.g., `site.ts` → `site.js`).
797
+
- Source maps are generated for debugging.
798
+
- With `--verbose`, shows detailed compilation output for each file.
799
+
800
+
### 10.4 `dotnet frontend watch [--verbose]`
801
+
802
+
- Same as `dev`, but continues running and monitors for changes.
803
+
- Watches `jsRoot` and `cssRoot` directories for file changes.
804
+
- Automatically recompiles when `.ts`, `.tsx`, `.scss`, or `.sass` files are modified.
<Description>CLI tool for MvcFrontendKit - compile TypeScript/SCSS during development, validate config and check assets. Uses esbuild and Dart Sass.</Description>
Copy file name to clipboardExpand all lines: src/MvcFrontendKit/MvcFrontendKit.csproj
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
<TargetFramework>net10.0</TargetFramework>
5
5
<ImplicitUsings>enable</ImplicitUsings>
6
6
<Nullable>enable</Nullable>
7
-
<Version>1.0.0-preview.29</Version>
7
+
<Version>1.0.0</Version>
8
8
<Authors>stef-k</Authors>
9
9
<Description>Node-free frontend bundling toolkit for ASP.NET Core MVC / Razor applications. Uses esbuild for JS/TS bundling and Dart Sass for SCSS compilation.</Description>
0 commit comments