diff --git a/package.json b/package.json index 2a2cf2b..7b8872d 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@babel/core": "^7.24.4", "@babel/eslint-parser": "^7.24.1", "@babel/preset-env": "^7.24.4", + "@vitejs/plugin-basic-ssl": "^1.1.0", "babel-preset-solid": "^1.8.17", "eslint": "^8.57.0", "eslint-plugin-solid": "^0.14.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c25b331..54b79b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ importers: '@babel/preset-env': specifier: ^7.24.4 version: 7.24.4(@babel/core@7.24.4) + '@vitejs/plugin-basic-ssl': + specifier: ^1.1.0 + version: 1.1.0(vite@5.2.11) babel-preset-solid: specifier: ^1.8.17 version: 1.8.17(@babel/core@7.24.4) @@ -1116,6 +1119,12 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vitejs/plugin-basic-ssl@1.1.0': + resolution: {integrity: sha512-wO4Dk/rm8u7RNhOf95ZzcEmC9rYOncYgvq4z3duaJrCgjN8BxAnDVyndanfcJZ0O6XZzHz6Q0hTimxTg8Y9g/A==} + engines: {node: '>=14.6.0'} + peerDependencies: + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3175,6 +3184,10 @@ snapshots: '@ungap/structured-clone@1.2.0': {} + '@vitejs/plugin-basic-ssl@1.1.0(vite@5.2.11)': + dependencies: + vite: 5.2.11 + acorn-jsx@5.3.2(acorn@8.11.3): dependencies: acorn: 8.11.3 diff --git a/vite.config.js b/vite.config.js index 6e535cd..18b927c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,40 +1,33 @@ -// import { readFileSync } from 'node:fs'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vite'; import solidPlugin from 'vite-plugin-solid'; +// import basicSsl from '@vitejs/plugin-basic-ssl'; export default defineConfig({ - base: '/solidjs-js-template/', + base: '/solidjs-js-template', plugins: [ - /* - Uncomment the following line to enable solid-devtools. - For more info see https://github.com/thetarnav/solid-devtools/tree/main/packages/extension#readme - */ + // Uncomment the following line to enable solid-devtools. + // For more info see https://github.com/thetarnav/solid-devtools/tree/main/packages/extension#readme // devtools(), solidPlugin(), + // Allows using self-signed certificates to run the dev server using HTTPS. + // https://www.npmjs.com/package/@vitejs/plugin-basic-ssl + // basicSsl(), ], - // Uncomment the next lines in case, you would like to run Vite dev server using HTTPS and in case, - // you have key and certificate. You retrieve your certificate and key using mkcert. - // Learn more: - // https://docs.telegram-mini-apps.com/platform/getting-app-link#mkcert - // - // server: { - // port: 443, - // https: { - // cert: readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), './tma.internal.pem')), - // key: readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), './tma.internal-key.pem')), - // }, - // host: 'tma.internal', - // }, build: { target: 'esnext', }, + publicDir: './public', + server: { + // Uncomment this line if you want to expose your dev server and access it from the devices + // in the same network. + // host: true, + }, resolve: { alias: { '@': resolve(dirname(fileURLToPath(import.meta.url)), './src'), } }, - publicDir: './public', });