mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix common & static paths
This commit is contained in:
parent
8e510f5aac
commit
a4d66fffda
@ -5,7 +5,7 @@
|
|||||||
"version": "3.5.0-beta.1",
|
"version": "3.5.0-beta.1",
|
||||||
"main": "src/main",
|
"main": "src/main",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "electron-webpack dev",
|
"dev": "DEBUG=true electron-webpack dev",
|
||||||
"compile": "yarn download-bins && yarn i18n:compile && electron-webpack compile",
|
"compile": "yarn download-bins && yarn i18n:compile && electron-webpack compile",
|
||||||
"compile:main": "electron-webpack main",
|
"compile:main": "electron-webpack main",
|
||||||
"compile:renderer": "electron-webpack renderer",
|
"compile:renderer": "electron-webpack renderer",
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"node": ">=12.0 <13.0"
|
"node": ">=12.0 <13.0"
|
||||||
},
|
},
|
||||||
"electronWebpack": {
|
"electronWebpack": {
|
||||||
"commonSourceDirectory": "./common",
|
"commonSourceDirectory": "./src/common",
|
||||||
"staticSourceDirectory": "./static",
|
"staticSourceDirectory": "./static",
|
||||||
"main": {
|
"main": {
|
||||||
"sourceDirectory": "./src/main"
|
"sourceDirectory": "./src/main"
|
||||||
|
|||||||
@ -15,8 +15,6 @@ const Call = require('@hapi/call');
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const Subtext = require('@hapi/subtext');
|
const Subtext = require('@hapi/subtext');
|
||||||
|
|
||||||
const assetsPath = path.join(__static, "build/client")
|
|
||||||
|
|
||||||
const mimeTypes: {[key: string]: string} = {
|
const mimeTypes: {[key: string]: string} = {
|
||||||
"html": "text/html",
|
"html": "text/html",
|
||||||
"txt": "text/plain",
|
"txt": "text/plain",
|
||||||
@ -87,7 +85,7 @@ export class Router {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected handleStaticFile(file: string, response: http.ServerResponse) {
|
protected handleStaticFile(file: string, response: http.ServerResponse) {
|
||||||
const asset = path.join(assetsPath, file)
|
const asset = path.join(__static, file)
|
||||||
readFile(asset, (err, data) => {
|
readFile(asset, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
// default to index.html so that react routes work when page is refreshed
|
// default to index.html so that react routes work when page is refreshed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user