Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit b405bb5

Browse files
authored
Merge pull request #321 from alephjs/feat-0.3-beta
Land 0.3 beta
2 parents c43f951 + 4695d4a commit b405bb5

File tree

115 files changed

+6333
-6102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+6333
-6102
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ You will need [Deno](https://deno.land/) 1.8+.
2222

2323
```bash
2424
# ssr/development with HMR
25-
ALEPH_DEV=true deno run -A --unstable --location=http://0.0.0.0 cli.ts dev ./examples/hello-world -L debug
25+
ALEPH_DEV=true deno run -A --unstable --location=http://localhost cli.ts dev ./examples/hello-world -L debug
2626

2727
# ssr/production
28-
ALEPH_DEV=true deno run -A --unstable --location=http://0.0.0.0 cli.ts start ./examples/hello-world -L debug
28+
ALEPH_DEV=true deno run -A --unstable --location=http://localhost cli.ts start ./examples/hello-world -L debug
2929

3030
# ssg
31-
ALEPH_DEV=true deno run -A --unstable --location=http://0.0.0.0 cli.ts build ./examples/hello-world -L debug
31+
ALEPH_DEV=true deno run -A --unstable --location=http://localhost cli.ts build ./examples/hello-world -L debug
3232

3333
# run all tests
34-
deno test -A --unstable --location=http://0.0.0.0 --import-map=./import_map.json
34+
deno test -A --unstable --location=http://localhost --import-map=./import_map.json
3535
```
3636

3737
## Project Structure

bundler/esbuild.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
import { join } from 'https://deno.land/std@0.96.0/path/mod.ts'
1+
import { join } from 'https://deno.land/std@0.100.0/path/mod.ts'
22
import { cache } from '../server/cache.ts'
33
import util from '../shared/util.ts'
4-
// @deno-types="https://deno.land/x/esbuild@v0.11.22/mod.d.ts"
5-
import { build, stop, Plugin } from 'https://deno.land/x/esbuild@v0.11.22/mod.js'
4+
// @deno-types="https://deno.land/x/esbuild@v0.12.22/mod.d.ts"
5+
import { build, stop, Plugin } from 'https://deno.land/x/esbuild@v0.12.22/mod.js'
66

77
export {
88
build as esbuild,
99
stop as stopEsbuild
1010
}
1111

12-
export const esbuildUrlLoader: Plugin = {
13-
name: 'http-loader',
12+
export const esmLoader: Plugin = {
13+
name: 'esm-loader',
1414
setup(build) {
1515
build.onResolve({ filter: /.*/ }, args => {
16-
if (util.isLikelyHttpURL(args.path)) {
16+
const isRemote = util.isLikelyHttpURL(args.path)
17+
const path = isRemote ? args.path : util.trimPrefix(args.path, 'file://')
18+
19+
if (
20+
args.kind === 'url-token' ||
21+
(args.kind === 'import-rule' && (isRemote || path.startsWith('/')))
22+
) {
23+
return { path: path, external: true }
24+
}
25+
if (isRemote) {
1726
return {
18-
path: args.path,
27+
path,
1928
namespace: 'http-module',
2029
}
2130
}
2231
if (args.namespace === 'http-module') {
2332
return {
24-
path: (new URL(args.path, args.importer)).toString(),
33+
path: (new URL(path, args.importer)).toString(),
2534
namespace: 'http-module',
2635
}
2736
}
28-
const [path] = util.splitBy(util.trimPrefix(args.path, 'file://'), '#')
2937
if (path.startsWith('.')) {
3038
return { path: join(args.resolveDir, path) }
3139
}

0 commit comments

Comments
 (0)