From cda065780a8a4984db4624f3252c7e2bba18981d Mon Sep 17 00:00:00 2001 From: hackrobot Date: Tue, 21 May 2024 17:11:08 +0800 Subject: [PATCH] update --- .erb/configs/webpack.config.renderer.dev.ts | 5 ++ package.json | 4 +- src/main/main.ts | 6 ++ src/renderer/App.tsx | 29 +++++---- src/renderer/index.tsx | 2 + yarn.lock | 72 +++++++++++++++++++-- 6 files changed, 96 insertions(+), 22 deletions(-) diff --git a/.erb/configs/webpack.config.renderer.dev.ts b/.erb/configs/webpack.config.renderer.dev.ts index a6ca87e..4e23655 100644 --- a/.erb/configs/webpack.config.renderer.dev.ts +++ b/.erb/configs/webpack.config.renderer.dev.ts @@ -83,6 +83,10 @@ const configuration: webpack.Configuration = { use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /\.module\.s?(c|a)ss$/, }, + // { + // test: /\.scss$/, + // use: ['style-loader', 'css-loader', 'sass-loader'], + // }, // Fonts { test: /\.(woff|woff2|eot|ttf|otf)$/i, @@ -172,6 +176,7 @@ const configuration: webpack.Configuration = { devServer: { port, compress: true, + // hot: false, hot: true, headers: { 'Access-Control-Allow-Origin': '*' }, static: { diff --git a/package.json b/package.json index e838255..6cb18fa 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "electron-updater": "^6.1.4", "lodash": "^4.17.21", "marked": "^12.0.2", + "nodemon": "^3.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.16.0" @@ -126,7 +127,7 @@ "@typescript-eslint/parser": "^6.7.0", "browserslist-config-erb": "^0.0.3", "chalk": "^4.1.2", - "concurrently": "^8.2.1", + "concurrently": "^8.2.2", "core-js": "^3.32.2", "cross-env": "^7.0.3", "css-loader": "^6.8.1", @@ -135,6 +136,7 @@ "electron": "^26.2.1", "electron-builder": "^24.6.4", "electron-devtools-installer": "^3.2.0", + "electron-reload": "^2.0.0-alpha.1", "electronmon": "^2.0.2", "eslint": "^8.49.0", "eslint-config-airbnb-base": "^15.0.0", diff --git a/src/main/main.ts b/src/main/main.ts index 05b44eb..a200ecb 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -23,6 +23,12 @@ class AppUpdater { } } +// Enable live reload for all the files inside your project directory +// require('electron-reload')(path.join(__dirname, 'src'), { +// electron: require(`${__dirname}/node_modules/electron`) +// }); + + let mainWindow: BrowserWindow | null = null; ipcMain.on('ipc-example', async (event, arg) => { diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 51a4907..e4051de 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -1,6 +1,6 @@ import { Component, useRef } from 'react'; import { Input } from 'antd'; -import { Button, Flex } from 'antd' +import { Button, Flex } from 'antd'; // import Taro from "@tarojs/taro"; // import { // View, @@ -11,7 +11,9 @@ import { Button, Flex } from 'antd' // Editor, // Textarea, // } from "@tarojs/components"; -import './APP.scss'; +// import './APP.scss'; +import styles from './App.module.scss'; + // import { AtTabBar } from "taro-ui"; import React, { useCallback, useEffect, useState } from 'react'; // import { AtGrid } from "taro-ui"; @@ -229,7 +231,6 @@ renderer.paragraph = function (text) { // return `

${text}

\n`; // return `

${text}

`; return `
${text}
`; - }; renderer.br = function () { return '
'; @@ -276,9 +277,9 @@ const Index = () => { const copyToClipboard = () => { if (divRef.current) { const htmlContentinnerHTML = divRef.current.innerHTML; - console.log('htmlContentinnerHTML',htmlContentinnerHTML) + console.log('htmlContentinnerHTML', htmlContentinnerHTML); const htmlContentouterHTML = divRef.current.outerHTML; - console.log('htmlContentouterHTML',htmlContentouterHTML) + console.log('htmlContentouterHTML', htmlContentouterHTML); const htmlContent = divRef.current.innerText; @@ -294,32 +295,32 @@ const Index = () => { }; return ( -
-
-
+
+
+
{/* */}
-
+
{/* */} {/* */}
-
+
{' '} -
+