Skip to content

Commit a8b4d2d

Browse files
authored
Merge pull request #385 from karthik2804/fix_precompile
Fix precompile
2 parents 69cfc3e + 24b3d1c commit a8b4d2d

File tree

11 files changed

+1733
-4
lines changed

11 files changed

+1733
-4
lines changed

packages/build-tools/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/build-tools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@spinframework/build-tools",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

packages/build-tools/src/precompile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ export function precompile(source, filename = '<input>', moduleMode = false, pre
4747
},
4848
});
4949

50-
if (!precompileCalls.length) return source;
50+
if (!precompileCalls.length) {
51+
// No regex to precompile so return original source.
52+
return {
53+
content: source,
54+
sourceMap: null
55+
};
56+
}
5157

5258
magicString.prepend(`${PREAMBLE}${precompileCalls.join('\n')}${POSTAMBLE}`);
5359

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
target
4+
.spin/
5+
build/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# `http-js` Template
2+
3+
A starter template for building JavaScript HTTP applications with Spin.
4+
5+
## Getting Started
6+
7+
Build the App
8+
9+
```bash
10+
spin build
11+
```
12+
13+
## Run the App
14+
15+
```bash
16+
spin up
17+
```
18+
19+
## Using Spin Interfaces
20+
21+
To use additional Spin interfaces, install the corresponding packages:
22+
23+
| Interface | Package |
24+
|---------------|---------------------------------|
25+
| Key-Value | `@spinframework/spin-kv` |
26+
| LLM | `@spinframework/spin-llm` |
27+
| MQTT | `@spinframework/spin-mqtt` |
28+
| MySQL | `@spinframework/spin-mysql` |
29+
| PostgreSQL | `@spinframework/spin-postgres` |
30+
| Redis | `@spinframework/spin-redis` |
31+
| SQLite | `@spinframework/spin-sqlite` |
32+
| Variables | `@spinframework/spin-variables` |

0 commit comments

Comments
 (0)