We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b303a16 commit 8d9eef6Copy full SHA for 8d9eef6
plugins/json.ts
@@ -0,0 +1,17 @@
1
+import type { Plugin } from '../types.d.ts'
2
+
3
+// todo: remove this plugin when deno support `json` module
4
+// check https://github.com/denoland/deno/issues/7623
5
+export default (): Plugin => {
6
+ return {
7
+ name: 'json-loader',
8
+ setup: aleph => {
9
+ aleph.onLoad(/\.json$/i, async ({ specifier }) => {
10
+ const { content } = await aleph.fetchModule(specifier)
11
12
+ code: `export default ` + new TextDecoder().decode(content)
13
+ }
14
+ })
15
16
17
+}
0 commit comments