initial commit
This commit is contained in:
parent
7a9182c016
commit
3d55db34b5
21 changed files with 2952 additions and 93 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
node_modules
|
||||
.vscode
|
||||
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
3
.vscode/extensions.json
vendored
Normal file
3
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"recommendations": ["svelte.svelte-vscode"]
|
||||
}
|
||||
28
Dockerfile
Normal file
28
Dockerfile
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Use Node.js as the base image
|
||||
FROM node:16-alpine
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the package.json and package-lock.json files
|
||||
COPY ./ ./
|
||||
|
||||
# Install the dependencies
|
||||
RUN npm install
|
||||
RUN npm i -g vite
|
||||
RUN npm run build --host
|
||||
|
||||
# Copy the rest of the source code
|
||||
#COPY . .
|
||||
|
||||
# Build the Vite and Svelte app
|
||||
#RUN npm run build
|
||||
|
||||
# Set the environment variable for production
|
||||
#ENV NODE_ENV=production
|
||||
|
||||
# Expose the default port used by the web app
|
||||
EXPOSE 5173
|
||||
|
||||
# Start the app
|
||||
CMD [ "npm", "start" ]
|
||||
93
README.md
93
README.md
|
|
@ -1,93 +0,0 @@
|
|||
# QR Pigeon
|
||||
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin https://gitlab.com/spencerflagg/qr-pigeon.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](https://gitlab.com/spencerflagg/qr-pigeon/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
13
index.html
Normal file
13
index.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>QR PIGEON</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
2499
package-lock.json
generated
Normal file
2499
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
26
package.json
Normal file
26
package.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "qr-pigeon",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"start": "vite serve --host"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^2.0.0",
|
||||
"@tsconfig/svelte": "^3.0.0",
|
||||
"svelte": "^3.54.0",
|
||||
"svelte-check": "^2.10.0",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^4.9.3",
|
||||
"vite": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"canvg": "^4.0.1",
|
||||
"qrcode-svg": "^1.1.0"
|
||||
}
|
||||
}
|
||||
BIN
public/icon.png
Normal file
BIN
public/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
17
src/App.svelte
Normal file
17
src/App.svelte
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<script lang="ts">
|
||||
import logo from './assets/logo.svg'
|
||||
import Qr from './lib/Qr.svelte'
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<div class="logo">
|
||||
<img src={logo} alt="">
|
||||
</div>
|
||||
<div class="main__content">
|
||||
<Qr />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
157
src/app.css
Normal file
157
src/app.css
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
:root {
|
||||
--bkg: rgb(36, 35, 30);
|
||||
}
|
||||
|
||||
html {
|
||||
overflow: overlay
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Inter", sans-serif;
|
||||
font-family: monospace;
|
||||
font-size: max(3vmin, 16pt);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: monospace;
|
||||
background-color: var(--bkg);
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: top;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.main__content {
|
||||
width: min(100vw - 4rem, 600px);
|
||||
padding: 2rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.logo{
|
||||
position: fixed;
|
||||
bottom: .5rem;
|
||||
left: 1rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
width: 6rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 1rem;
|
||||
text-transform: uppercase;
|
||||
font: inherit;
|
||||
border: 0;
|
||||
color: rgb(29, 28, 26);
|
||||
padding: 0.5rem 1.5rem;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.25s ease-in-out, letter-spacing 0.25s ease-out;
|
||||
letter-spacing: 1ch;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transition: background-color 0.25s ease-in-out;
|
||||
}
|
||||
|
||||
.btn--primary {
|
||||
background-color: rgb(236, 202, 8);
|
||||
}
|
||||
|
||||
.btn--primary:hover {
|
||||
background-color: rgb(236, 183, 8);
|
||||
letter-spacing: 3rem;
|
||||
transition: background-color 0.25s ease-in-out, letter-spacing 5s ease-out;
|
||||
}
|
||||
|
||||
.btn--secondary {
|
||||
background-color: rgb(218, 215, 201);
|
||||
padding-left: calc(1.5rem + 1ch);
|
||||
}
|
||||
|
||||
.btn--secondary:hover {
|
||||
background-color: rgb(150, 147, 134);
|
||||
}
|
||||
|
||||
#qrcode {
|
||||
text-align: center;
|
||||
margin-bottom: -.25rem;
|
||||
}
|
||||
|
||||
#qrcode svg {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
width: auto;
|
||||
max-height: calc(100vh - 16rem);
|
||||
min-height: 200px;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
textarea {
|
||||
min-height: 5rem;
|
||||
font: inherit;
|
||||
font-size: inherit;
|
||||
padding: 0.8rem 1rem;
|
||||
width: calc(100% - 2rem);
|
||||
border: 0;
|
||||
background-color: #bbb;
|
||||
color: rgb(53, 51, 39);
|
||||
border-radius: 1rem 1rem 0.2rem 1rem;
|
||||
vertical-align: middle;
|
||||
transition: all 0.25s ease-in-out;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
textarea::spelling-error {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
textarea:focus {
|
||||
background-color: #ddd;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#charcount {
|
||||
font-family: monospace;
|
||||
color: rgb(105, 101, 75);
|
||||
background-color: var(--bkg);
|
||||
padding: 0.2em 0.4em;
|
||||
border-radius: 0.2em;
|
||||
margin-top: -1.8rem;
|
||||
margin-bottom: 0.2rem;
|
||||
margin-right: 0.2rem;
|
||||
align-self: end;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#outputs {
|
||||
margin-top: 1rem;
|
||||
transition: all 0.3s;
|
||||
transform-origin: top;
|
||||
}
|
||||
|
||||
#outputs {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
18
src/assets/logo.svg
Normal file
18
src/assets/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 29 KiB |
1
src/assets/svelte.svg
Normal file
1
src/assets/svelte.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
10
src/lib/Counter.svelte
Normal file
10
src/lib/Counter.svelte
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<script lang="ts">
|
||||
let count: number = 0
|
||||
const increment = () => {
|
||||
count += 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<button on:click={increment}>
|
||||
count is {count}
|
||||
</button>
|
||||
92
src/lib/Qr.svelte
Normal file
92
src/lib/Qr.svelte
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<script lang="ts">
|
||||
import QRCode from "qrcode-svg";
|
||||
import { Canvg } from "canvg";
|
||||
|
||||
let qrSVG: string;
|
||||
let qrText = "";
|
||||
|
||||
$: qrSVG = qrText
|
||||
? new QRCode({
|
||||
content: qrText.replace(/</g, "<").replace(/>/g, ">"),
|
||||
join: true,
|
||||
width: 512,
|
||||
height: 512,
|
||||
container: 'svg-viewbox',
|
||||
}).svg()
|
||||
: null;
|
||||
|
||||
let remaining = 2300;
|
||||
|
||||
$: remaining = 2300 - qrText.length;
|
||||
|
||||
function genSvg() {
|
||||
return new QRCode({
|
||||
content: qrText.replace(/</g, "<").replace(/>/g, ">"),
|
||||
join: true,
|
||||
width: "512",
|
||||
height: "512",
|
||||
container: 'svg-viewbox',
|
||||
}).svg();
|
||||
}
|
||||
|
||||
function genPNG() {
|
||||
const canvas = document.getElementById("canv");
|
||||
const ctx = canvas.getContext("2d");
|
||||
const svg = genSvg();
|
||||
|
||||
const rend = Canvg.fromString(ctx, svg);
|
||||
rend.start();
|
||||
|
||||
return canvas.toDataURL("img/png");
|
||||
}
|
||||
|
||||
function downloadSVG() {
|
||||
const fileName = `${encodeURI(qrText.slice(0, 20))}.svg`;
|
||||
const link = document.createElement("a");
|
||||
const svgBlob = new Blob([qrSVG], {
|
||||
type: "image/svg+xml;charset=utf-8",
|
||||
});
|
||||
const svgUrl = URL.createObjectURL(svgBlob);
|
||||
|
||||
link.download = fileName;
|
||||
link.href = svgUrl;
|
||||
link.click();
|
||||
}
|
||||
|
||||
function downloadPNG() {
|
||||
var link = document.createElement("a");
|
||||
|
||||
link.download = `${encodeURI(qrText)}.png`;
|
||||
link.href = genPNG();
|
||||
|
||||
link.click();
|
||||
}
|
||||
|
||||
function generateQRCode(text: string) {
|
||||
qrText = "";
|
||||
}
|
||||
</script>
|
||||
|
||||
<textarea
|
||||
rows={6}
|
||||
maxlength={2300}
|
||||
bind:value={qrText}
|
||||
placeholder="url or text"
|
||||
on:input={() => {
|
||||
if (qrText.length > 2300) qrText = qrText.slice(0, 2300);
|
||||
}}
|
||||
/>
|
||||
<span id="charcount"><span class:red={remaining < 100}>{remaining}</span>/2300</span>
|
||||
|
||||
{#if qrSVG}
|
||||
<div id="outputs">
|
||||
<div id="qrcode" class="qr-code">
|
||||
{@html qrSVG}
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button class="btn btn--secondary" on:click={downloadSVG}>SVG</button>
|
||||
<button class="btn btn--secondary" on:click={downloadPNG}>PNG</button>
|
||||
</div>
|
||||
<canvas id="canv" style="display: none" />
|
||||
</div>
|
||||
{/if}
|
||||
8
src/main.ts
Normal file
8
src/main.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import './app.css'
|
||||
import App from './App.svelte'
|
||||
|
||||
const app = new App({
|
||||
target: document.getElementById('app'),
|
||||
})
|
||||
|
||||
export default app
|
||||
2
src/vite-env.d.ts
vendored
Normal file
2
src/vite-env.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
||||
7
svelte.config.js
Normal file
7
svelte.config.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
export default {
|
||||
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: vitePreprocess(),
|
||||
}
|
||||
20
tsconfig.json
Normal file
20
tsconfig.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
* Note that setting allowJs false does not prevent the use
|
||||
* of JS in `.svelte` files.
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
8
tsconfig.node.json
Normal file
8
tsconfig.node.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
17
vite.config.ts
Normal file
17
vite.config.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
plugins: [svelte()],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: `[name].[hash].js`,
|
||||
chunkFileNames: `[name].[hash].js`,
|
||||
assetFileNames: `[name].[hash].[ext]`
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Reference in a new issue