Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Replace snowpack with vite
Sebastian Martinez committed 4 years ago
commit 27a11c9b5488064c916ed60689417426355c1430
parent 1960c4fe79c3b7c15ef4f72de88b32b605c701aa
7 files changed +45 -66
added index.html
@@ -0,0 +1,19 @@
+
<!DOCTYPE html>
+
<html lang="en">
+
  <head>
+
    <meta charset="utf-8" />
+
    <meta name="viewport" content="width=device-width, initial-scale=1" />
+
    <meta name="description" content="Interact with Radicle" />
+
    <meta name="theme-color" content="#0e171f">
+
    <link rel="stylesheet" type="text/css" href="/index.css" />
+
    <link rel="icon" href="/favicon.ico">
+
    <link rel="icon" href="/favicon.svg" type="image/svg+xml">
+
    <link rel="preload" href="/fonts/Inter-Regular.woff" as="font" type="font/woff">
+
    <link rel="preload" href="/fonts/Inter-SemiBold.otf" as="font" type="font/otf">
+

+
    <title>Radicle Interface</title>
+
  </head>
+
  <body>
+
    <script type="module" src="/src/index.ts"></script>
+
  </body>
+
</html>
deleted public/index.html
@@ -1,19 +0,0 @@
-
<!DOCTYPE html>
-
<html lang="en">
-
  <head>
-
    <meta charset="utf-8" />
-
    <meta name="viewport" content="width=device-width, initial-scale=1" />
-
    <meta name="description" content="Interact with Radicle" />
-
    <meta name="theme-color" content="#0e171f">
-
    <link rel="stylesheet" type="text/css" href="/index.css" />
-
    <link rel="icon" href="/favicon.ico">
-
    <link rel="icon" href="/favicon.svg" type="image/svg+xml">
-
    <link rel="preload" href="/fonts/Inter-Regular.woff" as="font" type="font/woff">
-
    <link rel="preload" href="/fonts/Inter-SemiBold.otf" as="font" type="font/otf">
-

-
    <title>Radicle Interface</title>
-
  </head>
-
  <body>
-
    <script type="module" src="/dist/index.js"></script>
-
  </body>
-
</html>
modified scripts/build
@@ -1,4 +1,4 @@
#!/bin/sh

-
snowpack build
+
vite build
cp _redirects build/_redirects
deleted snowpack.config.js
@@ -1,38 +0,0 @@
-
/** @type {import("snowpack").SnowpackUserConfig } */
-
module.exports = {
-
  env: {
-
    RADICLE_ALCHEMY_API_KEY: process.env.RADICLE_ALCHEMY_API_KEY,
-
    RADICLE_HTTP_API: process.env.RADICLE_HTTP_API,
-
  },
-
  mount: {
-
    public: '/',
-
    src: '/dist',
-
  },
-
  alias: {
-
    '@app': './src',
-
  },
-
  plugins: [
-
    '@snowpack/plugin-svelte',
-
    '@snowpack/plugin-typescript',
-
  ],
-
  routes: [
-
    /* Enable an SPA Fallback in development: */
-
    {"match": "routes", "src": ".*", "dest": "/index.html"},
-
    {"match": "all", "src": "/projects/.*", "dest": "/index.html"},
-
    {"match": "all", "src": "/orgs/.*/projects/.*", "dest": "/index.html"},
-
  ],
-
  optimize: {
-
    /* Setting `bundle: true` breaks .json imports in snowpack 3.5.0 */
-
    "bundle": false,
-
  },
-
  packageOptions: {
-
    polyfillNode: true,
-
  },
-
  devOptions: {
-
    open: "none",
-
    output: "dashboard"
-
  },
-
  buildOptions: {
-
    sourcemap: true,
-
  },
-
};
modified svelte.config.js
@@ -1,9 +1,7 @@
-
const autoPreprocess = require('svelte-preprocess');
+
import sveltePreprocess from "svelte-preprocess";

-
module.exports = {
-
  preprocess: autoPreprocess({
-
    defaults: {
-
      script: 'typescript',
-
    },
-
  }),
+
export default {
+
  // Consult https://github.com/sveltejs/svelte-preprocess
+
  // for more information about preprocessors
+
  preprocess: sveltePreprocess(),
};
modified tsconfig.json
@@ -10,7 +10,8 @@
    "target": "es2020",
    "module": "es2020",
    "types": [
-
      "svelte"
+
      "svelte",
+
      "vite/client"
    ],
    "sourceMap": true,
    "moduleResolution": "node",
added vite.config.ts
@@ -0,0 +1,18 @@
+
import path from "path";
+
import { UserConfig } from "vite";
+
import { svelte } from "@sveltejs/vite-plugin-svelte";
+

+
// https://vitejs.dev/config/
+
const config: UserConfig = {
+
  optimizeDeps:{
+
    exclude:['svelte-routing']
+
  },
+
  plugins: [svelte()],
+
  resolve: {
+
    alias: {
+
      "@app": path.resolve("./src"),
+
    },
+
  },
+
};
+

+
export default config;