Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support legacy browsers #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 110 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
"@types/pako": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"@vitejs/plugin-legacy": "^1.4.3",
"cbor": "^7.0.5",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-svelte3": "^3.2.0",
"node-fetch": "^2.6.1",
"prettier": "~2.2.1",
"prettier-plugin-svelte": "^2.2.0",
"regenerator-runtime": "^0.13.7",
"svelte": "^3.38.2",
"svelte-check": "^1.5.2",
"svelte-preprocess": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/lib/detect_certificate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "vite/dynamic-import-polyfill"
import type { CommonCertificateInfo } from './common_certificate_info';
import type { DBEvent } from './event';

Expand Down
1 change: 1 addition & 0 deletions src/routes/_myWalletStore.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "vite/dynamic-import-polyfill"
import { writable } from 'svelte/store';

const localforage = import('localforage'); // Can fail on node
Expand Down
3 changes: 2 additions & 1 deletion src/routes/import/file.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import "vite/dynamic-import-polyfill"
import CodeFound from '../_CodeFound.svelte';
import { Alert } from 'sveltestrap';
import { BarcodeFormat, DecodeHintType, NotFoundException } from '@zxing/library';
Expand Down Expand Up @@ -66,7 +67,7 @@
canvas.width /= 2;
canvas.height /= 2;
ctx.drawImage(original, 0, 0, canvas.width, canvas.height);
console.log(`Resized canvas to ${canvas.width}x${canvas.height}`)
console.log(`Resized canvas to ${canvas.width}x${canvas.height}`);
await new Promise((r) => setTimeout(r, 1000)); // wait 100ms
} while (canvas.width > 100 && canvas.height > 100);
throw err;
Expand Down
8 changes: 8 additions & 0 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import preprocess from 'svelte-preprocess';
import adapter_static from '@sveltejs/adapter-static';
import adapter_node from '@sveltejs/adapter-node';
import vite_plugin_legacy from '@vitejs/plugin-legacy';

const adapter =
process.env.SVELTEKIT_ADAPTER === 'node'
Expand All @@ -18,6 +19,13 @@ const config = {
target: '#svelte',
adapter,
vite: {
plugins: [
vite_plugin_legacy({
targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
})
],

build: {
chunkSizeWarningLimit: 800
}
Expand Down