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

Documentation: systemInfo API #11

Open
el3um4s opened this issue Feb 22, 2022 · 1 comment
Open

Documentation: systemInfo API #11

el3um4s opened this issue Feb 22, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@el3um4s
Copy link
Owner

el3um4s commented Feb 22, 2022

No description provided.

@el3um4s el3um4s added the documentation Improvements or additions to documentation label Feb 22, 2022
@el3um4s
Copy link
Owner Author

el3um4s commented Aug 14, 2022

This is the first version

Import https://github.com/el3um4s/ipc-for-electron-system-info - https://www.npmjs.com/package/@el3um4s/ipc-for-electron-system-info

npm i @el3um4s/ipc-for-electron-system-info

With vite you need to use: https://www.npmjs.com/package/vite-plugin-externals

vite.config.ts

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";

import { viteExternalsPlugin } from "vite-plugin-externals";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    svelte(),
    viteExternalsPlugin({
      electron: "Electron",
    }),
  ],
});

repair.js

import {
    readFile,
    writeFile
} from 'fs';

readFile('./dist/index.html', 'utf8', (err, data) => {
    if (err) {
        console.error(err);
        return;
    }
    const repaired = data.replaceAll(`href="/`, `href="`).replaceAll(`src="/`, `src="`);
    writeFile('./dist/index.html', repaired, 'utf8', (err) => {
        if (err) {
            console.error(err);
            return;
        }
    });
});
{
"scripts": {
    "dev": "vite",
    "build": "vite build & npm run repair",
    "preview": "vite preview",
    "check": "svelte-check --tsconfig ./tsconfig.json",
    "repair": "node repair.js"
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant