Skip to content

Commit

Permalink
Add vite basic ssl plugin
Browse files Browse the repository at this point in the history
- This autogenerates self-signed certs in dev mode when HTTPS env is set
- Made to match the CRA behaviour
  • Loading branch information
twk3 committed Jan 4, 2024
1 parent 71c7f51 commit 59b10ab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/desktop-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@types/uuid": "^9.0.2",
"@types/webpack-bundle-analyzer": "^4.6.0",
"@use-gesture/react": "^10.3.0",
"@vitejs/plugin-basic-ssl": "^1.0.2",
"@vitejs/plugin-react-swc": "^3.5.0",
"chokidar": "^3.5.3",
"cross-env": "^7.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const TransactionHeader = memo(
/>
{showBalance && <Cell value="Balance" width={88} textAlign="right" />}
{showCleared && <Field width={23} truncate={false} />}
<Cell value="" width={scrollWidth ? 5 + scrollWidth : 0} />
<Cell value="" width={5 + (scrollWidth ?? 0)} />
</Row>
);
},
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop-client/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as path from 'path';

import inject from '@rollup/plugin-inject';
import basicSsl from '@vitejs/plugin-basic-ssl';
import react from '@vitejs/plugin-react-swc';
import { visualizer } from 'rollup-plugin-visualizer';
/// <reference types="vitest" />
Expand Down Expand Up @@ -165,6 +166,7 @@ export default defineConfig(async ({ mode }) => {
}),
viteTsconfigPaths({ root: '../..' }),
visualizer({ template: 'raw-data' }),
!!env.HTTPS && basicSsl(),
],
test: {
include: ['src/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ __metadata:
"@types/uuid": "npm:^9.0.2"
"@types/webpack-bundle-analyzer": "npm:^4.6.0"
"@use-gesture/react": "npm:^10.3.0"
"@vitejs/plugin-basic-ssl": "npm:^1.0.2"
"@vitejs/plugin-react-swc": "npm:^3.5.0"
chokidar: "npm:^3.5.3"
cross-env: "npm:^7.0.3"
Expand Down Expand Up @@ -4527,6 +4528,15 @@ __metadata:
languageName: node
linkType: hard

"@vitejs/plugin-basic-ssl@npm:^1.0.2":
version: 1.0.2
resolution: "@vitejs/plugin-basic-ssl@npm:1.0.2"
peerDependencies:
vite: ^3.0.0 || ^4.0.0 || ^5.0.0
checksum: ee9be91254d848278dba3dbf5c73726bb181dcfba6972dfb657db0e1b0f3d25567aac3ed179924d5ae503848e74824f3284547d792e0f6d7ca02dbec32fb6510
languageName: node
linkType: hard

"@vitejs/plugin-react-swc@npm:^3.5.0":
version: 3.5.0
resolution: "@vitejs/plugin-react-swc@npm:3.5.0"
Expand Down

0 comments on commit 59b10ab

Please sign in to comment.