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

use isolatedmodules with babel

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-11-24 10:51:41 +02:00
parent 2f17a7ec67
commit 61d79e2630
7 changed files with 18 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{
"presets": [
"@babel/preset-env",
["@babel/preset-env", {"modules": false}],
"@babel/preset-react",
"@lingui/babel-preset-react"
],

View File

@ -1,9 +1,11 @@
export { isAllowedResource } from "../../common/rbac";
export { apiManager } from "../../renderer/api/api-manager";
export { KubeObjectStore } from "../../renderer/kube-object.store";
export { KubeApi, forCluster, IKubeApiCluster } from "../../renderer/api/kube-api";
export { KubeApi, forCluster } from "../../renderer/api/kube-api";
export type { IKubeApiCluster } from "../../renderer/api/kube-api";
export { KubeObject } from "../../renderer/api/kube-object";
export { Pod, podsApi, PodsApi, IPodContainer, IPodContainerStatus } from "../../renderer/api/endpoints";
export { Pod, podsApi, PodsApi } from "../../renderer/api/endpoints";
export type { IPodContainer, IPodContainerStatus } from "../../renderer/api/endpoints";
export { Node, nodesApi, NodesApi } from "../../renderer/api/endpoints";
export { Deployment, deploymentApi, DeploymentApi } from "../../renderer/api/endpoints";
export { DaemonSet, daemonSetApi } from "../../renderer/api/endpoints";
@ -11,7 +13,8 @@ export { StatefulSet, statefulSetApi } from "../../renderer/api/endpoints";
export { Job, jobApi } from "../../renderer/api/endpoints";
export { CronJob, cronJobApi } from "../../renderer/api/endpoints";
export { ConfigMap, configMapApi } from "../../renderer/api/endpoints";
export { Secret, secretsApi, ISecretRef } from "../../renderer/api/endpoints";
export { Secret, secretsApi } from "../../renderer/api/endpoints";
export type { ISecretRef } from "../../renderer/api/endpoints";
export { ReplicaSet, replicaSetApi } from "../../renderer/api/endpoints";
export { ResourceQuota, resourceQuotaApi } from "../../renderer/api/endpoints";
export { HorizontalPodAutoscaler, hpaApi } from "../../renderer/api/endpoints";
@ -31,7 +34,8 @@ export { RoleBinding, roleBindingApi } from "../../renderer/api/endpoints";
export { ClusterRole, clusterRoleApi } from "../../renderer/api/endpoints";
export { ClusterRoleBinding, clusterRoleBindingApi } from "../../renderer/api/endpoints";
export { CustomResourceDefinition, crdApi } from "../../renderer/api/endpoints";
export { KubeObjectStatus, KubeObjectStatusLevel } from "./kube-object-status";
export { KubeObjectStatusLevel } from "./kube-object-status";
export type { KubeObjectStatus } from "./kube-object-status";
// stores
export type { EventStore } from "../../renderer/components/+events/event.store";

View File

@ -1,3 +1,3 @@
export { navigate } from "../../renderer/navigation";
export { hideDetails, showDetails, getDetailsUrl } from "../../renderer/navigation";
export { IURLParams } from "../../common/utils/buildUrl";
export type { IURLParams } from "../../common/utils/buildUrl";

View File

@ -11,7 +11,8 @@ import isBoolean from "lodash/isBoolean";
import uniqueId from "lodash/uniqueId";
const { conditionalValidators, ...InputValidators } = Validators;
export { InputValidators, InputValidator };
export { InputValidators };
export type { InputValidator };
type InputElement = HTMLInputElement | HTMLTextAreaElement;
type InputElementProps = InputHTMLAttributes<InputElement> & TextareaHTMLAttributes<InputElement> & DOMAttributes<InputElement>;

View File

@ -2,7 +2,7 @@
"compilerOptions": {
"baseUrl": ".",
"jsx": "react",
"target": "ES2017",
"target": "ES2019",
"module": "ESNext",
"lib": [
"ESNext",
@ -23,6 +23,7 @@
"allowSyntheticDefaultImports": true,
"traceResolution": false,
"resolveJsonModule": true,
"isolatedModules": true,
"paths": {
"*": [
"node_modules/*",

View File

@ -23,6 +23,9 @@ export default function (): webpack.Configuration {
resolve: {
extensions: ['.json', '.js', '.ts']
},
optimization: {
usedExports: true,
},
externals: [
nodeExternals()
],

View File

@ -57,6 +57,7 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
},
optimization: {
minimize: isProduction,
usedExports: true,
minimizer: [
new TerserPlugin({
cache: true,
@ -85,11 +86,6 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
{
loader: "babel-loader",
options: {
presets: [
["@babel/preset-env", {
modules: "commonjs" // ling-ui
}],
],
plugins: [
isDevelopment && require.resolve('react-refresh/babel'),
].filter(Boolean),