1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix: export Dialog to extensions-api (#2105)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2021-02-09 17:33:27 +02:00 committed by GitHub
parent 035dd470ef
commit 741973dd29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -16,7 +16,7 @@
"dev-run": "nodemon --watch static/build/main.js --exec \"electron --inspect .\"",
"dev:main": "yarn run compile:main --watch",
"dev:renderer": "yarn run webpack-dev-server --config webpack.renderer.ts",
"dev:extension-types": "yarn run compile:extension-types --watch",
"dev:extension-types": "yarn run compile:extension-types --watch --progress",
"compile": "env NODE_ENV=production concurrently yarn:compile:*",
"compile:main": "yarn run webpack --config webpack.main.ts",
"compile:renderer": "yarn run webpack --config webpack.renderer.ts",

View File

@ -146,11 +146,10 @@ export class Dialog extends React.PureComponent<DialogProps, DialogState> {
{dialog}
</Animate>
);
}
else if (!this.isOpen) {
} else if (!this.isOpen) {
return null;
}
return createPortal(dialog, document.body);
return createPortal(dialog, document.body) as React.ReactPortal;
}
}

View File

@ -1,9 +1,9 @@
import path from "path";
import webpack from "webpack";
import { sassCommonVars } from "./src/common/vars";
import { sassCommonVars, isDevelopment } from "./src/common/vars";
export default function (): webpack.Configuration {
export default function generateExtensionTypes(): webpack.Configuration {
const entry = "./src/extensions/extension-api.ts";
const outDir = "./src/extensions/npm/extensions/dist";
@ -22,6 +22,10 @@ export default function (): webpack.Configuration {
// e.g. require('@k8slens/extensions')
libraryTarget: "commonjs"
},
cache: isDevelopment,
optimization: {
minimize: false, // speed up types compilation
},
module: {
rules: [
{