mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix config import error, allow to run separated webpack's renderer configs for both apps
This commit is contained in:
parent
58c814d7eb
commit
1169b862b3
13
.babelrc
13
.babelrc
@ -1,14 +1,8 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"modules": "commonjs",
|
||||
"targets": {
|
||||
"esmodules": false
|
||||
}
|
||||
}
|
||||
],
|
||||
["@babel/preset-env", {
|
||||
"modules": "commonjs"
|
||||
}],
|
||||
"@babel/preset-react",
|
||||
"@lingui/babel-preset-react"
|
||||
],
|
||||
@ -18,7 +12,6 @@
|
||||
[
|
||||
"@babel/plugin-transform-runtime",
|
||||
{
|
||||
"absoluteRuntime": false,
|
||||
"regenerator": true,
|
||||
"useESModules": true
|
||||
}
|
||||
|
||||
14
package.json
14
package.json
@ -5,13 +5,15 @@
|
||||
"version": "3.5.0-beta.1",
|
||||
"main": "dist/main.js",
|
||||
"scripts": {
|
||||
"dev": "concurrently yarn:dev:*",
|
||||
"dev": "concurrently 'yarn dev:main' 'yarn dev:renderer'",
|
||||
"dev-run": "electron --inspect .",
|
||||
"dev:main": "DEBUG=true webpack --watch --progress --config webpack.main.ts",
|
||||
"dev:renderer": "DEBUG=true webpack --watch --progress --config webpack.renderer.ts",
|
||||
"compile": "NODE_ENV=production concurrently 'yarn download-bins' 'yarn i18n:compile' && concurrently yarn:compile:*",
|
||||
"compile:main": "NODE_ENV=production webpack --progress --config webpack.main.ts $@",
|
||||
"compile:renderer": "NODE_ENV=production webpack --progress --config webpack.renderer.ts $@",
|
||||
"dev:main": "DEBUG=true yarn compile:main --watch $@",
|
||||
"dev:renderer": "DEBUG=true yarn compile:renderer --watch $@",
|
||||
"dev:react": "yarn dev:renderer --config-name react",
|
||||
"dev:vue": "yarn dev:renderer --config-name vue",
|
||||
"compile": "yarn download-bins && concurrently 'yarn i18n:compile' 'yarn compile:main -p' 'yarn compile:renderer -p'",
|
||||
"compile:main": "webpack --progress --config webpack.main.ts $@",
|
||||
"compile:renderer": "webpack --progress --config webpack.renderer.ts $@",
|
||||
"compile:dll": "webpack --config webpack.dll.ts $@",
|
||||
"build:linux": "yarn compile && electron-builder --linux --dir -c.productName=LensDev",
|
||||
"build:mac": "yarn compile && electron-builder --mac --dir -c.productName=LensDev",
|
||||
|
||||
@ -7,7 +7,6 @@ import { readFileSync, watch } from "fs"
|
||||
import { PromiseIpc } from "electron-promise-ipc"
|
||||
import { findMainWebContents } from "./webcontents"
|
||||
import * as url from "url"
|
||||
import { apiPrefix } from "../common/vars";
|
||||
|
||||
export class KubeAuthProxy {
|
||||
public lastError: string
|
||||
|
||||
@ -155,6 +155,7 @@ export default function initMenu(opts: MenuOptions, promiseIpc: any) {
|
||||
...(isDevelopment ? [
|
||||
{ role: 'toggleDevTools' } as MenuItemConstructorOptions,
|
||||
{
|
||||
accelerator: "CmdOrCtrl+Shift+I",
|
||||
label: 'Open Dashboard Devtools',
|
||||
click() {
|
||||
webContents.getFocusedWebContents().openDevTools()
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { observable, when } from "mobx";
|
||||
import type { IConfigRoutePayload } from "../main/routes/config";
|
||||
|
||||
import { observable, when } from "mobx";
|
||||
import { autobind, interval } from "./utils";
|
||||
import { configApi } from "./api/endpoints";
|
||||
import { configApi } from "./api/endpoints/config.api";
|
||||
|
||||
@autobind()
|
||||
export class ConfigStore {
|
||||
|
||||
@ -15,8 +15,9 @@ export default [
|
||||
export function webpackConfigReact(): webpack.Configuration {
|
||||
return {
|
||||
context: __dirname,
|
||||
name: "react",
|
||||
target: "web",
|
||||
devtool: isProduction ? "source-map" : "cheap-eval-source-map",
|
||||
devtool: "source-map", // todo: optimize in dev-mode with webpack.SourceMapDevToolPlugin
|
||||
mode: isProduction ? "production" : "development",
|
||||
cache: isDevelopment,
|
||||
entry: {
|
||||
@ -66,6 +67,7 @@ export function webpackConfigReact(): webpack.Configuration {
|
||||
// https://lingui.js.org/guides/typescript.html
|
||||
jsx: "preserve",
|
||||
target: "es2016",
|
||||
module: "esnext",
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -138,6 +140,7 @@ export function webpackConfigReact(): webpack.Configuration {
|
||||
export function webpackConfigVue(): webpack.Configuration {
|
||||
const config = webpackConfigReact();
|
||||
|
||||
config.name = "vue"
|
||||
config.target = "electron-renderer";
|
||||
config.resolve.extensions.push(".vue");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user