aboutsummaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src/import-plugin-browser.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/src/import-plugin-browser.ts')
-rw-r--r--packages/markdown/remark/src/import-plugin-browser.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/markdown/remark/src/import-plugin-browser.ts b/packages/markdown/remark/src/import-plugin-browser.ts
new file mode 100644
index 000000000..5fb90ad0b
--- /dev/null
+++ b/packages/markdown/remark/src/import-plugin-browser.ts
@@ -0,0 +1,8 @@
+// This file should be imported as `#import-plugin`
+import type * as unified from 'unified';
+
+// In the browser, we can try to do a plain import
+export async function importPlugin(p: string): Promise<unified.Plugin> {
+ const importResult = await import(p);
+ return importResult.default;
+}