Update Vite to 3.0

- Replaces `sanitize-html` with `xss` due to Node core modules
  dependencies
- Remove empty style tag from SeedDropdown
- Update devServer ports
- Replace vite-plugin-rewrite-all
- Add node events polyfill

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2022-08-02 15:13:32 +02:00
committed by Alexis Sellier
parent 115934a38c
commit da0b4200cd
6 changed files with 631 additions and 463 deletions
+7 -11
View File
@@ -4,7 +4,7 @@
import matter from "@radicle/gray-matter";
import type * as proj from "@app/project";
import { getImageMime } from "@app/utils";
import sanitizeHtml from "sanitize-html";
import xss, { getDefaultWhiteList } from "xss";
export let content: string;
export let getImage: (path: string) => Promise<proj.Blob>;
@@ -15,18 +15,14 @@
let container: HTMLElement;
const render = (content: string): string => {
return sanitizeHtml(marked.parse(content), {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([
"img",
"audio",
"video",
]),
allowedAttributes: {
...sanitizeHtml.defaults.allowedAttributes,
video: ["src"],
return xss(marked.parse(content), {
whiteList: {
...getDefaultWhiteList(),
img: ["src"],
audio: ["src"],
video: ["src"]
},
disallowedTagsMode: "escape",
stripIgnoreTag: false,
});
};
-3
View File
@@ -20,9 +20,6 @@
};
</script>
<style>
</style>
{#await formatSeeds() then items}
<Dropdown
{items}
+5
View File
@@ -0,0 +1,5 @@
// This shim is used as a stand-in for the node "events" library, used by
// the "keccack" package depended on by @gnosis.pm/safe-core-sdk.
import events from 'events';
export default events;