http-server-rs 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -137,6 +137,8 @@ Options:
137
137
  Will live transpile TypeScript to JavaScript on request. This allows serving TypeScript sources
138
138
  directly to the browser without a build step.
139
139
 
140
+ This is designed to simplify local development for bundler-less configurations. Use native ESM imports built into your browser and create your project without a build step.
141
+
140
142
  ```bash
141
143
  http-server-rs serve --transpile --port 8080 ./testing/transpile/react
142
144
 
@@ -144,6 +146,14 @@ http-server-rs serve --transpile --port 8080 ./testing/transpile/react
144
146
  curl http://localhost:8080/app.tsx
145
147
  ```
146
148
 
149
+ https://github.com/user-attachments/assets/3d1bc313-e898-42bb-8c8f-a8023c41ec35
150
+
151
+ Notes;
152
+ - Use builtin `import` syntax and get npm packages from a CDN like [esm.sh](https://esm.sh/#tsx)
153
+ - Use [importmap](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap) to map ESM imports to Node.js resolution patterns
154
+ - `npm install` is only required for types. Unfortunately this requires full package installation until the TypeScript team [comes to a decision on remote declaration file](https://github.com/microsoft/TypeScript/issues/28985)
155
+ - For performance sensitive applications, you'll still probably want to use a bundler for production - but who know, this might be good enough for most use cases
156
+
147
157
  ## Watch Mode
148
158
 
149
159
  `http-server` under `--watch` mode can watch the served directory for changes and emit an event to the client notifying of a change. By default the server will intercept html files and inject a JavaScript script which subscribes to change events and triggers a page reload.
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-server-rs",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {