update: upgrade webpack to version 5 and cleanup a bit of renderer code

This commit is contained in:
Xymorot 2021-01-06 00:58:12 +01:00
parent 0e58f115b4
commit 657ec825ab
7 changed files with 493 additions and 2569 deletions

View File

@ -1 +1,7 @@
declare module '*.svelte';
declare module '*.svelte' {
class Component {
public constructor(options: { target: HTMLElement });
}
export = Component;
}

3012
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -96,8 +96,8 @@
"svelte-loader": "^2.13.6",
"ts-loader": "^8.0.14",
"typescript": "^4.1.3",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
"webpack": "^5.11.1",
"webpack-cli": "^4.3.1"
},
"repository": "https://git.fuwafuwa.moe/Xymorot/RenaiApp",
"bugs": "https://git.fuwafuwa.moe/Xymorot/RenaiApp/issues",

View File

@ -12,22 +12,14 @@ module.exports = {
rules: [
{
test: /\.svelte$/,
loader: [
{
loader: 'svelte-loader',
},
],
loader: 'svelte-loader',
},
{
test: /\.ts$/,
loader: [
{
loader: 'ts-loader',
options: {
configFile: path.resolve('tsconfig.renderer.json'),
},
},
],
loader: 'ts-loader',
options: {
configFile: path.resolve('tsconfig.renderer.json'),
},
},
{
test: /\.mjs$/,

View File

@ -1,15 +1,5 @@
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
import App from './renderer/App.svelte';
((): void =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return -- fix this together with the typescript support of svelte
new App({
target: document.querySelector('#app'),
props: {
// we'll learn about props later
answer: 42,
},
}))();
new App({
target: document.querySelector('#app'),
});

View File

@ -1,6 +1,6 @@
<script>
import { t } from '../../services/utils';
import Bttn from '../1-atoms/Bttn.svelte';
import SvelteButton from '../1-atoms/SvelteButton.svelte';
import { nhentaiSaveFavorites } from '../../services/api';
function handleClick() {
@ -11,5 +11,5 @@
<style></style>
<div class="nhentai-login">
<Bttn on:click="{handleClick}">{ t('Save nhentai Favorites') }</Bttn>
<SvelteButton on:click="{handleClick}">{ t('Save nhentai Favorites') }</SvelteButton>
</div>