feat:backup
This commit is contained in:
parent
a7a6c52e18
commit
56418aeea4
|
@ -1,7 +1,5 @@
|
||||||
const CracoLessPlugin = require('craco-less');
|
const CracoLessPlugin = require('craco-less');
|
||||||
function resolve(dir) {
|
const HtmlWebpackPlugin=require('html-webpack-plugin')
|
||||||
return path.join(__dirname, dir);
|
|
||||||
}
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -21,26 +19,14 @@ module.exports = {
|
||||||
configure: (webpackConfig, { env, paths }) => {
|
configure: (webpackConfig, { env, paths }) => {
|
||||||
// 修改output.publicPath为'./'
|
// 修改output.publicPath为'./'
|
||||||
// webpackConfig.output.publicPath = './';
|
// webpackConfig.output.publicPath = './';
|
||||||
webpackConfig.output.path = path.join(__dirname,"/build");
|
webpackConfig.output.path = path.join(__dirname,);
|
||||||
webpackConfig.output.publicPath = "./";
|
webpackConfig.output.publicPath = "";
|
||||||
// webpackConfig.output.module
|
|
||||||
// .rule("icons")
|
|
||||||
// .test(/\.svg$/)
|
|
||||||
// .include.add(resolve("src/icons"))
|
|
||||||
// .end()
|
|
||||||
// .use("svg-sprite-loader")
|
|
||||||
// .loader("svg-sprite-loader")
|
|
||||||
// .options({
|
|
||||||
// symbolId: "icon-[name]",
|
|
||||||
// })
|
|
||||||
// .end()
|
|
||||||
return webpackConfig;
|
return webpackConfig;
|
||||||
},
|
},
|
||||||
alias: {
|
},
|
||||||
// 将@/*映射为src目录
|
devServer: {
|
||||||
'@': path.resolve(__dirname, 'src/'),
|
port: 3005, // 设置端口
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
4
main.js
4
main.js
|
@ -18,9 +18,10 @@ const createWindow = () => {
|
||||||
preload: path.join(__dirname, 'preload.js')
|
preload: path.join(__dirname, 'preload.js')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log("isDev", isDev)
|
||||||
if (isDev){
|
if (isDev){
|
||||||
// 加载 index.html
|
// 加载 index.html
|
||||||
win.loadURL('http://localhost:3000')
|
win.loadURL('http://localhost:3005')
|
||||||
// 打开开发工具
|
// 打开开发工具
|
||||||
win.webContents.openDevTools()
|
win.webContents.openDevTools()
|
||||||
}else {
|
}else {
|
||||||
|
@ -29,7 +30,6 @@ const createWindow = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// let okPush =false
|
// let okPush =false
|
||||||
let devToolPush = false
|
|
||||||
win.webContents.on('before-input-event', (event, input) => {
|
win.webContents.on('before-input-event', (event, input) => {
|
||||||
console.log("input.type.toLowerCase()", input)
|
console.log("input.type.toLowerCase()", input)
|
||||||
if (input.control && input.key.toLowerCase() === 's' && input.type.toLowerCase() === "keydown" && input.isAutoRepeat === false) {
|
if (input.control && input.key.toLowerCase() === 's' && input.type.toLowerCase() === "keydown" && input.isAutoRepeat === false) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"name": "my-electron-app",
|
"name": "assistant-note",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Hello World!",
|
"description": "note",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"author": "hua",
|
"author": "hua",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"@ant-design/icons": "^5.3.7",
|
"@ant-design/icons": "^5.3.7",
|
||||||
"@ant-design/pro-components": "^2.3.57",
|
"@ant-design/pro-components": "^2.3.57",
|
||||||
"@craco/craco": "^6.0.0",
|
"@craco/craco": "^6.4.5",
|
||||||
"@electron-forge/cli": "^6.0.4",
|
"@electron-forge/cli": "^6.0.4",
|
||||||
"@electron-forge/maker-deb": "^6.0.4",
|
"@electron-forge/maker-deb": "^6.0.4",
|
||||||
"@electron-forge/maker-rpm": "^6.0.4",
|
"@electron-forge/maker-rpm": "^6.0.4",
|
||||||
|
@ -54,10 +54,10 @@
|
||||||
"yjs": ">=13.5.42"
|
"yjs": ">=13.5.42"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "concurrently \"wait-on http://localhost:3000 && electron .\" \"cross-env BROWSER=none npm start\"",
|
"dev": "concurrently \"wait-on http://localhost:3005 && electron .\" \"cross-env BROWSER=none npm start\"",
|
||||||
"start": "craco start --verbose",
|
"start": "craco start --verbose",
|
||||||
"build": "craco build",
|
"build": "craco build",
|
||||||
"startel": "electron .",
|
"startel": "set NODE_ENV=development&&electron .",
|
||||||
"package": "electron-forge package",
|
"package": "electron-forge package",
|
||||||
"make": "electron-forge make"
|
"make": "electron-forge make"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<!-- %PUBLIC_URL% public 文件夹 -->
|
<!-- %PUBLIC_URL% public 文件夹 -->
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="icon" href="favicon.ico" />
|
||||||
<!-- 移动端网页适配 -->
|
<!-- 移动端网页适配 -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<!-- 配置浏览器页签+地址颜色,仅适用于android -->
|
<!-- 配置浏览器页签+地址颜色,仅适用于android -->
|
||||||
|
@ -15,11 +15,7 @@
|
||||||
<!-- 应用加壳 -->
|
<!-- 应用加壳 -->
|
||||||
<!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
|
<!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
|
||||||
<title>Note</title>
|
<title>Note</title>
|
||||||
<!--[if IE]>
|
<!-- <script src="index.jsx"></script>-->
|
||||||
<script src="js/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<script src="index.jsx"></script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { BrowserRouter } from 'react-router-dom';
|
||||||
import {PersistGate} from "redux-persist/integration/react";
|
import {PersistGate} from "redux-persist/integration/react";
|
||||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||||
root.render(
|
root.render(
|
||||||
// <React.StrictMode>
|
<React.StrictMode>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<PersistGate loading={null} persistor={persistor}>
|
<PersistGate loading={null} persistor={persistor}>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
|
@ -16,5 +16,5 @@ root.render(
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</PersistGate>
|
</PersistGate>
|
||||||
</Provider>
|
</Provider>
|
||||||
// </React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
// const {createProxyMiddleware} = require('http-proxy-middleware')
|
const {createProxyMiddleware} = require('http-proxy-middleware')
|
||||||
// module.exports=function(app){
|
module.exports=function(app){
|
||||||
// app.use(
|
app.use(
|
||||||
// createProxyMiddleware('/ticai',{
|
createProxyMiddleware('/ticai',{
|
||||||
// target:'http://localhost:8090/',
|
target:'http://localhost:8090/',
|
||||||
// changeOrigin:false,
|
changeOrigin:false,
|
||||||
// pathRewrite:{'^/ticai':''}
|
pathRewrite:{'^/ticai':''}
|
||||||
// }),
|
}),
|
||||||
// createProxyMiddleware('/oauth',{
|
createProxyMiddleware('/oauth',{
|
||||||
// target:'http://localhost:1112',
|
target:'http://localhost:1112',
|
||||||
// changeOrigin:true,
|
changeOrigin:true,
|
||||||
// pathRewrite:{'^/oauth':''}
|
pathRewrite:{'^/oauth':''}
|
||||||
// })
|
})
|
||||||
// )
|
)
|
||||||
// }
|
}
|
Loading…
Reference in New Issue