This repository was archived by the owner on Mar 13, 2025. It is now read-only.
Commit a1cff3c
Switch back to CommonJS modules
A primary goal of Miniflare is to provide a *fun* developer
experience. Currently, this is not the case when using Miniflare with
a certain popular testing framework (**cough**, ~~Jest~~, **cough**),
because it and its ecosystem's support for ESM isn't great yet.
This also makes it easier to upgrade from Miniflare 1. Node lets
you import CommonJS modules in ES modules so this won't break those.
We'll look at switching to ES modules again later...
- Switch esbuild format to `cjs` and set platform to `node`
- Replace `"type": "module"` and `"exports"` with `"main"` in
`package.json`s
- Replace all dynamic `import()`s with `require()`s
- Remove all uses of `import.meta.url`
- Use `@ava/typescript` for tests instead of custom TypeScript loader
Closes #119
Co-authored-by: Kikobeats <[email protected]>1 parent 0ab1f32 commit a1cff3c
File tree
50 files changed
+178
-196
lines changed- packages
- cache
- cli-parser
- src
- core
- src
- plugins
- standards
- test/plugins
- durable-objects
- html-rewriter
- src
- test
- http-server
- src
- jest-environment-miniflare
- test
- kv
- miniflare
- src
- test
- runner-vm
- test
- scheduler
- src
- sites
- src
- test
- fixtures
- storage-file
- storage-memory
- storage-redis
- watcher
- web-sockets
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+178
-196
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
96 | | - | |
97 | 94 | | |
98 | 95 | | |
99 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
734 | 736 | | |
735 | | - | |
| 737 | + | |
736 | 738 | | |
737 | 739 | | |
738 | 740 | | |
| |||
0 commit comments