feat:backup
This commit is contained in:
parent
a7a6c52e18
commit
56418aeea4
|
@ -1,7 +1,5 @@
|
|||
const CracoLessPlugin = require('craco-less');
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
const HtmlWebpackPlugin=require('html-webpack-plugin')
|
||||
const path = require('path');
|
||||
module.exports = {
|
||||
plugins: [
|
||||
|
@ -21,26 +19,14 @@ module.exports = {
|
|||
configure: (webpackConfig, { env, paths }) => {
|
||||
// 修改output.publicPath为'./'
|
||||
// webpackConfig.output.publicPath = './';
|
||||
webpackConfig.output.path = path.join(__dirname,"/build");
|
||||
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()
|
||||
webpackConfig.output.path = path.join(__dirname,);
|
||||
webpackConfig.output.publicPath = "";
|
||||
return webpackConfig;
|
||||
},
|
||||
alias: {
|
||||
// 将@/*映射为src目录
|
||||
'@': path.resolve(__dirname, 'src/'),
|
||||
},
|
||||
}
|
||||
devServer: {
|
||||
port: 3005, // 设置端口
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
|
4
main.js
4
main.js
|
@ -18,9 +18,10 @@ const createWindow = () => {
|
|||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
console.log("isDev", isDev)
|
||||
if (isDev){
|
||||
// 加载 index.html
|
||||
win.loadURL('http://localhost:3000')
|
||||
win.loadURL('http://localhost:3005')
|
||||
// 打开开发工具
|
||||
win.webContents.openDevTools()
|
||||
}else {
|
||||
|
@ -29,7 +30,6 @@ const createWindow = () => {
|
|||
}
|
||||
|
||||
// let okPush =false
|
||||
let devToolPush = false
|
||||
win.webContents.on('before-input-event', (event, input) => {
|
||||
console.log("input.type.toLowerCase()", input)
|
||||
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",
|
||||
"description": "Hello World!",
|
||||
"description": "note",
|
||||
"main": "main.js",
|
||||
"author": "hua",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"devDependencies": {
|
||||
"@ant-design/icons": "^5.3.7",
|
||||
"@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/maker-deb": "^6.0.4",
|
||||
"@electron-forge/maker-rpm": "^6.0.4",
|
||||
|
@ -54,10 +54,10 @@
|
|||
"yjs": ">=13.5.42"
|
||||
},
|
||||
"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",
|
||||
"build": "craco build",
|
||||
"startel": "electron .",
|
||||
"startel": "set NODE_ENV=development&&electron .",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make"
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!-- %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" />
|
||||
<!-- 配置浏览器页签+地址颜色,仅适用于android -->
|
||||
|
@ -15,11 +15,7 @@
|
|||
<!-- 应用加壳 -->
|
||||
<!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
|
||||
<title>Note</title>
|
||||
<!--[if IE]>
|
||||
<script src="js/html5.js"></script>
|
||||
<![endif]-->
|
||||
<script src="index.jsx"></script>
|
||||
|
||||
<!-- <script src="index.jsx"></script>-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@ import { BrowserRouter } from 'react-router-dom';
|
|||
import {PersistGate} from "redux-persist/integration/react";
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
// <React.StrictMode>
|
||||
<React.StrictMode>
|
||||
<Provider store={store}>
|
||||
<PersistGate loading={null} persistor={persistor}>
|
||||
<BrowserRouter>
|
||||
|
@ -16,5 +16,5 @@ root.render(
|
|||
</BrowserRouter>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
// </React.StrictMode>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
// const {createProxyMiddleware} = require('http-proxy-middleware')
|
||||
// module.exports=function(app){
|
||||
// app.use(
|
||||
// createProxyMiddleware('/ticai',{
|
||||
// target:'http://localhost:8090/',
|
||||
// changeOrigin:false,
|
||||
// pathRewrite:{'^/ticai':''}
|
||||
// }),
|
||||
// createProxyMiddleware('/oauth',{
|
||||
// target:'http://localhost:1112',
|
||||
// changeOrigin:true,
|
||||
// pathRewrite:{'^/oauth':''}
|
||||
// })
|
||||
// )
|
||||
// }
|
||||
const {createProxyMiddleware} = require('http-proxy-middleware')
|
||||
module.exports=function(app){
|
||||
app.use(
|
||||
createProxyMiddleware('/ticai',{
|
||||
target:'http://localhost:8090/',
|
||||
changeOrigin:false,
|
||||
pathRewrite:{'^/ticai':''}
|
||||
}),
|
||||
createProxyMiddleware('/oauth',{
|
||||
target:'http://localhost:1112',
|
||||
changeOrigin:true,
|
||||
pathRewrite:{'^/oauth':''}
|
||||
})
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue