Skip to content

Commit

Permalink
fix webpack build and ignore hermes flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
cgdibble committed Jan 22, 2024
1 parent d044ebc commit b87b37a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[ignore]
.*/node_modules/hermes-estree
.*/node_modules/babel-plugin-flow-runtime
.*/node_modules/flow-runtime
.*/node_modules/cross-domain-safe-weakmap/dist
Expand Down
23 changes: 1 addition & 22 deletions vitestSetup.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
/* @flow */

export const sdkClientTestGlobals = {
__PORT__: 8000,
__STAGE_HOST__: "sandbox.paypal.com",
__HOST__: "test.paypal.com",
__HOSTNAME__: "test.paypal.com",
__SDK_HOST__: "test.paypal.com",
__PATH__: "/sdk/js",

__ENV__: "test",
__VERSION__: "1.0.45",
__CORRELATION_ID__: "abc123",
__NAMESPACE__: "paypaltest",
__PAYPAL_DOMAIN__: "mock://www.paypal.com",
__PAYPAL_API_DOMAIN__: "mock://sandbox.paypal.com",
__COMPONENTS__: ["buttons"],
__DISABLE_SET_COOKIE__: true,
__EXPERIMENTATION__: {
__EXPERIENCE__: "1122",
__TREATMENT__: "1234",
},
};
import { sdkClientTestGlobals } from "./test/globals";

const applyEnvs = () => {
Object.keys(sdkClientTestGlobals).forEach((k) => {
Expand Down
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
import type { WebpackConfig } from "@krakenjs/grumbler-scripts/config/types";
import { getWebpackConfig } from "@krakenjs/grumbler-scripts/config/webpack.config";

import { sdkClientTestGlobals } from "./vitestSetup";
import { sdkClientTestGlobals } from "./test/globals";

export const WEBPACK_CONFIG_TEST: WebpackConfig = getWebpackConfig({
test: true,
vars: {
...sdkClientTestGlobals,
},
});

// eslint-disable-next-line import/no-default-export
export default [WEBPACK_CONFIG_TEST];

0 comments on commit b87b37a

Please sign in to comment.