@meetelise/chat 1.25.0 → 1.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/coverage/lcov-report/base.css +224 -0
  2. package/coverage/lcov-report/block-navigation.js +79 -0
  3. package/coverage/lcov-report/favicon.png +0 -0
  4. package/coverage/lcov-report/index.html +111 -0
  5. package/coverage/lcov-report/index.js.html +17093 -0
  6. package/coverage/lcov-report/prettify.css +1 -0
  7. package/coverage/lcov-report/prettify.js +2 -0
  8. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  9. package/coverage/lcov-report/sorter.js +170 -0
  10. package/coverage/lcov.info +9986 -0
  11. package/dist/index.d.ts +1 -0
  12. package/package.json +1 -1
  13. package/.eslintignore +0 -2
  14. package/.eslintrc.cjs +0 -23
  15. package/.github/pull_request_template.md +0 -61
  16. package/.github/workflows/pull.yml +0 -46
  17. package/.github/workflows/release.yml +0 -23
  18. package/.husky/commit-msg +0 -2
  19. package/.husky/pre-commit +0 -4
  20. package/.idea/codeStyles/Project.xml +0 -57
  21. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  22. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  23. package/.idea/vcs.xml +0 -6
  24. package/.idea/workspace.xml +0 -67
  25. package/.prettierignore +0 -2
  26. package/.prettierrc.json +0 -1
  27. package/.vscode/settings.json +0 -13
  28. package/CONTRIBUTING.md +0 -36
  29. package/public/demo/index.html +0 -347
  30. package/public/demo/secret.html +0 -63
  31. package/src/MyPubnub.ts +0 -792
  32. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.ts +0 -86
  33. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.ts +0 -94
  34. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +0 -47
  35. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +0 -50
  36. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -46
  37. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +0 -70
  38. package/src/WebComponent/FeeCalculator/components/index.ts +0 -3
  39. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +0 -39
  40. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +0 -39
  41. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +0 -280
  42. package/src/WebComponent/FeeCalculator/fee-calculator.ts +0 -256
  43. package/src/WebComponent/FeeCalculator/index.ts +0 -4
  44. package/src/WebComponent/FeeCalculator/model/building-fee.ts +0 -83
  45. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +0 -23
  46. package/src/WebComponent/LeadSourceClient.ts +0 -332
  47. package/src/WebComponent/MEChat.css +0 -5
  48. package/src/WebComponent/OfficeHours.ts +0 -73
  49. package/src/WebComponent/Scheduler/date-picker.ts +0 -405
  50. package/src/WebComponent/Scheduler/time-picker.ts +0 -190
  51. package/src/WebComponent/Scheduler/tour-scheduler.ts +0 -1352
  52. package/src/WebComponent/Scheduler/tour-type-option.ts +0 -112
  53. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +0 -418
  54. package/src/WebComponent/actions/InputStyles.ts +0 -57
  55. package/src/WebComponent/actions/action-confirm-button.ts +0 -125
  56. package/src/WebComponent/actions/call-us-window.ts +0 -445
  57. package/src/WebComponent/actions/collapse-expand-button.ts +0 -65
  58. package/src/WebComponent/actions/details-window.ts +0 -150
  59. package/src/WebComponent/actions/email-us-window.ts +0 -555
  60. package/src/WebComponent/actions/formatPhoneNumber.ts +0 -72
  61. package/src/WebComponent/actions/minimize-expand-button.ts +0 -93
  62. package/src/WebComponent/chat-additional-actions.ts +0 -135
  63. package/src/WebComponent/health-chat.ts +0 -270
  64. package/src/WebComponent/healthchat-styles.ts +0 -119
  65. package/src/WebComponent/icons/ApplyOutlineIcon.ts +0 -22
  66. package/src/WebComponent/icons/BookTourOutlineIcon.ts +0 -13
  67. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +0 -22
  68. package/src/WebComponent/icons/ChatOutlineIcon.ts +0 -10
  69. package/src/WebComponent/icons/ChevronLeftIcon.ts +0 -7
  70. package/src/WebComponent/icons/ChevronRightIcon.ts +0 -7
  71. package/src/WebComponent/icons/ContactResidentIcon.ts +0 -9
  72. package/src/WebComponent/icons/DollarOutlineIcon.ts +0 -18
  73. package/src/WebComponent/icons/EmailOutlineIcon.ts +0 -7
  74. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +0 -12
  75. package/src/WebComponent/icons/PhoneOutlineIcon.ts +0 -7
  76. package/src/WebComponent/icons/SendMessageIcon.ts +0 -17
  77. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +0 -17
  78. package/src/WebComponent/icons/TourVirtuallyIcon.ts +0 -17
  79. package/src/WebComponent/icons/TourWithAgentIcon.ts +0 -17
  80. package/src/WebComponent/icons/XOutlineIcon.ts +0 -8
  81. package/src/WebComponent/index.ts +0 -2
  82. package/src/WebComponent/launcher/Launcher.ts +0 -1193
  83. package/src/WebComponent/launcher/launcherStyles.ts +0 -500
  84. package/src/WebComponent/launcher/mobile-launcher.ts +0 -159
  85. package/src/WebComponent/launcher/typeEmojiStyles.ts +0 -161
  86. package/src/WebComponent/launcher/typeMiniStyles.ts +0 -60
  87. package/src/WebComponent/launcher/typeMobileStyles.ts +0 -50
  88. package/src/WebComponent/leasing-chat-styles.ts +0 -114
  89. package/src/WebComponent/me-chat.ts +0 -1257
  90. package/src/WebComponent/me-select.ts +0 -322
  91. package/src/WebComponent/mini-loader.ts +0 -28
  92. package/src/WebComponent/pubnub-chat-styles.ts +0 -204
  93. package/src/WebComponent/pubnub-chat.ts +0 -928
  94. package/src/WebComponent/pubnub-media.ts +0 -208
  95. package/src/WebComponent/pubnub-message-styles.ts +0 -54
  96. package/src/WebComponent/pubnub-message.ts +0 -431
  97. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +0 -34
  98. package/src/WebComponent/simple-launcher/simple-launcher.ts +0 -100
  99. package/src/WebComponent/utilities-chat.ts +0 -270
  100. package/src/WebComponent/utilities-styles.ts +0 -110
  101. package/src/WebComponent/utils.ts +0 -82
  102. package/src/analytics.ts +0 -217
  103. package/src/assetUrls.ts +0 -6
  104. package/src/disclaimers.ts +0 -58
  105. package/src/fetchBuildingABTestType.ts +0 -21
  106. package/src/fetchBuildingInfo.ts +0 -87
  107. package/src/fetchBuildingWebchatView.ts +0 -154
  108. package/src/fetchFeatureFlag.ts +0 -250
  109. package/src/fetchLeadSources.ts +0 -98
  110. package/src/fetchPhoneNumberFromSource.ts +0 -31
  111. package/src/fetchWebchatPreferences.ts +0 -54
  112. package/src/getAvailabilities.ts +0 -174
  113. package/src/getBuildingPhoneNumber.ts +0 -26
  114. package/src/getShouldAllowScheduling.ts +0 -16
  115. package/src/getShouldShowWebchat.ts +0 -114
  116. package/src/getTimezoneString.ts +0 -39
  117. package/src/globals.ts +0 -1
  118. package/src/gtm.ts +0 -17
  119. package/src/handleChatId.ts +0 -101
  120. package/src/insertDNIIntoWebsite.ts +0 -146
  121. package/src/insertLeadSourceIntoSchedulerLinks.ts +0 -71
  122. package/src/main/MEChat.test.ts +0 -110
  123. package/src/main/MEChat.ts +0 -404
  124. package/src/main/utils.ts +0 -70
  125. package/src/postLeadSources.ts +0 -44
  126. package/src/rentgrata.ts +0 -74
  127. package/src/replaceSelectButtonsWithNewLink.ts +0 -68
  128. package/src/services/fees/fetchBuildingFees.ts +0 -28
  129. package/src/svgIcons.ts +0 -14
  130. package/src/themes.ts +0 -65
  131. package/src/types/rest-sdk.types.ts +0 -13
  132. package/src/types/webchat-no-show-reason.ts +0 -6
  133. package/src/utils.ts +0 -121
  134. package/tsconfig.json +0 -84
  135. package/web-test-runner.config.js +0 -10
  136. package/webpack.config.cjs +0 -48
package/src/themes.ts DELETED
@@ -1,65 +0,0 @@
1
- export const defaultPrimaryColor = "#646987"; // we have a brand color defined in the BE too, but this is a fallback
2
- export const defaultBackgroundColor = "#ffffff"; // default background color for the chat widget
3
-
4
- export const tintColor = (
5
- originalColor: string,
6
- tintOpacity: number
7
- ): string => {
8
- const originalRgb = hexToRgb(originalColor);
9
- const tintRgb = { r: 0, g: 0, b: 0 };
10
-
11
- const newRgb = {
12
- r: originalRgb.r + Math.round((tintRgb.r - originalRgb.r) * tintOpacity),
13
- g: originalRgb.g + Math.round((tintRgb.g - originalRgb.g) * tintOpacity),
14
- b: originalRgb.b + Math.round((tintRgb.b - originalRgb.b) * tintOpacity),
15
- };
16
-
17
- return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
18
- };
19
-
20
- const hexToRgb = (hex: string): { r: number; g: number; b: number } => {
21
- const r = parseInt(hex.substring(1, 3), 16);
22
- const g = parseInt(hex.substring(3, 5), 16);
23
- const b = parseInt(hex.substring(5, 7), 16);
24
- return { r, g, b };
25
- };
26
-
27
- const rgbToHex = (r: number, g: number, b: number): string => {
28
- return (
29
- "#" +
30
- [r, g, b]
31
- .map((c) => {
32
- const hex = c.toString(16);
33
- return hex.length === 1 ? "0" + hex : hex;
34
- })
35
- .join("")
36
- );
37
- };
38
-
39
- export const hexToAlmostWhite = (hexColor: string, ratio: number): string => {
40
- let r = parseInt(hexColor.substr(1, 2), 16);
41
- let g = parseInt(hexColor.substr(3, 2), 16);
42
- let b = parseInt(hexColor.substr(5, 2), 16);
43
-
44
- // the ratio of white to add (1 = white, 0 = no change)
45
- r = Math.round(r * (1 - ratio) + 255 * ratio);
46
- g = Math.round(g * (1 - ratio) + 255 * ratio);
47
- b = Math.round(b * (1 - ratio) + 255 * ratio);
48
-
49
- return (
50
- "#" +
51
- r.toString(16).padStart(2, "0") +
52
- g.toString(16).padStart(2, "0") +
53
- b.toString(16).padStart(2, "0")
54
- );
55
- };
56
-
57
- export const shouldUsePrimaryColorForChatFooter = (
58
- orgId: number,
59
- buildingId: number
60
- ): boolean => {
61
- // Some clients are complaining that we are NOT ADA compliant with our black, default chat footer
62
- // So we are temporarily adding this flag to allow them to use their brand color for the chat footer
63
- // Don't want to suddenly change it for our clients so added this flag
64
- return orgId === 2 || buildingId === 70392;
65
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Redeclare enum from rest-sdk to avoid pulling in entire module.
3
- */
4
- export enum TourAvailabilityResponseRankOrderedSupportedTourTypesEnum {
5
- Unknown = "UNKNOWN",
6
- SelfGuided = "SELF_GUIDED",
7
- VirtualShowing = "VIRTUAL_SHOWING",
8
- WithAgent = "WITH_AGENT",
9
- MediaTour = "MEDIA_TOUR",
10
- }
11
-
12
- // Types are safe to re-export as they are not included in runtime code.
13
- export type { TourAvailabilityResponse } from "@meetelise/rest-sdk";
@@ -1,6 +0,0 @@
1
- export type WebchatNoShowReason =
2
- | "building_does_not_exist"
3
- | "building_not_launched"
4
- | "building_not_active"
5
- | "building_in_maintenance_mode"
6
- | "building_not_webchat_scope_configured";
package/src/utils.ts DELETED
@@ -1,121 +0,0 @@
1
- import camelCase from "lodash/camelCase";
2
- import snakeCase from "lodash/snakeCase";
3
- import isArray from "lodash/isArray";
4
- import isObject from "lodash/isObject";
5
- import transform from "lodash/transform";
6
- import addHours from "date-fns/addHours";
7
- import isBefore from "date-fns/isBefore";
8
- import { BASE_DOMAIN } from "./globals";
9
-
10
- export const camelize = <T>(
11
- snakeCasedObject: Record<string, unknown>,
12
- keysToExclude?: (string | number | symbol)[]
13
- ): T =>
14
- transform(
15
- snakeCasedObject,
16
- (acc: Record<string, unknown>, value, key, target) => {
17
- const camelKey = keysToExclude?.includes(key)
18
- ? key
19
- : isArray(target)
20
- ? key
21
- : camelCase(String(key));
22
-
23
- acc[camelKey] = isObject(value)
24
- ? camelize(value as Record<string, unknown>, keysToExclude)
25
- : value;
26
- }
27
- ) as T;
28
-
29
- export const snakify = <T>(
30
- snakeCasedObject: Record<string, unknown>,
31
- keysToExclude?: (string | number | symbol)[]
32
- ): T =>
33
- transform(
34
- snakeCasedObject,
35
- (acc: Record<string, unknown>, value, key, target) => {
36
- const snakeKey = keysToExclude?.includes(key)
37
- ? key
38
- : isArray(target)
39
- ? key
40
- : snakeCase(String(key));
41
-
42
- acc[snakeKey] = isObject(value)
43
- ? snakify(value as Record<string, unknown>, keysToExclude)
44
- : value;
45
- }
46
- ) as T;
47
-
48
- export const isMobile = (): boolean =>
49
- window.matchMedia("(max-width: 767px)").matches ||
50
- window.matchMedia("(max-height: 400px)").matches;
51
-
52
- export const isTimestampExpired = (
53
- timestamp: Date,
54
- ttlHours: number
55
- ): boolean => {
56
- const expirationDate = addHours(timestamp, ttlHours);
57
- return isBefore(expirationDate, Date.now());
58
- };
59
-
60
- export const getCookieValue = (name: string): string | null => {
61
- try {
62
- const cookies = document.cookie.split("; ");
63
- const cookiePair = cookies
64
- .map((cookie) => cookie.split("="))
65
- .find(([cookieName]) => cookieName === name);
66
-
67
- return cookiePair ? decodeURIComponent(cookiePair[1]) : null;
68
- } catch (e) {
69
- // For debugging purposes if something happens on a client website
70
- // eslint-disable-next-line no-console
71
- console.warn(`Error getting cookie value for name=${name}`, e);
72
- return null;
73
- }
74
- };
75
-
76
- export const isValidPhoneNumber = (phoneNumber: string): boolean => {
77
- const phoneNumberRegex = /^\([2-9][0-8][0-9]\) [2-9][0-9][0-9]-[0-9]{4}$/;
78
- return phoneNumberRegex.test(phoneNumber);
79
- };
80
-
81
- export const isContainingEmail = (message: string): boolean => {
82
- try {
83
- const emailRegex = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/;
84
- return emailRegex.test(message);
85
- } catch (e) {
86
- // eslint-disable-next-line no-console
87
- console.warn(`Error checking if message contains email`, e);
88
- return false;
89
- }
90
- };
91
-
92
- /**
93
- * FooBarBizzBazz -> Foo Bar Bizz Bazz
94
- */
95
- export const sentenceTitleCase = (str: string): string => {
96
- const spaced = str.replace(/([A-Z])/g, " $1").trim();
97
- return spaced
98
- .split(" ")
99
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
100
- .join(" ");
101
- };
102
-
103
- export const formatCurrency = (
104
- amount: number,
105
- maximumFractionDigits = 0
106
- ): string => {
107
- return Intl.NumberFormat("en-US", {
108
- style: "currency",
109
- currency: "USD",
110
- minimumFractionDigits: 0,
111
- maximumFractionDigits,
112
- }).format(amount ?? 0);
113
- };
114
-
115
- export const isTestEnv = (): boolean => {
116
- const href = location.href;
117
- if (href.startsWith(BASE_DOMAIN + "/settings/widgets")) return true;
118
- if (href.startsWith(BASE_DOMAIN + "/demo")) return true;
119
- if (href.startsWith("http://localhost")) return true;
120
- return false;
121
- };
package/tsconfig.json DELETED
@@ -1,84 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
-
5
- /* Basic Options */
6
- // "incremental": true, /* Enable incremental compilation */
7
- "target": "es2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */,
8
- "module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
9
- "lib": [
10
- "esnext",
11
- "dom",
12
- "dom.iterable"
13
- ] /* Specify library files to be included in the compilation. */,
14
- // "allowJs": true, /* Allow javascript files to be compiled. */
15
- // "checkJs": true, /* Report errors in .js files. */
16
- "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */,
17
- "declaration": true /* Generates corresponding '.d.ts' file. */,
18
- // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
19
- "sourceMap": true /* Generates corresponding '.map' file. */,
20
- // "outFile": "./", /* Concatenate and emit output to single file. */
21
- "outDir": "./dist" /* Redirect output structure to the directory. */,
22
- // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
23
- // "composite": true, /* Enable project compilation */
24
- // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
25
- // "removeComments": true, /* Do not emit comments to output. */
26
- // "noEmit": true, /* Do not emit outputs. */
27
- // "importHelpers": true, /* Import emit helpers from 'tslib'. */
28
- // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
29
- // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
30
-
31
- /* Strict Type-Checking Options */
32
- "strict": true /* Enable all strict type-checking options. */,
33
- // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
34
- // "strictNullChecks": true, /* Enable strict null checks. */
35
- // "strictFunctionTypes": true, /* Enable strict checking of function types. */
36
- // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
37
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
38
- // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
39
- // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
40
-
41
- /* Additional Checks */
42
- // "noUnusedLocals": true, /* Report errors on unused locals. */
43
- // "noUnusedParameters": true, /* Report errors on unused parameters. */
44
- // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
45
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
46
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
47
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */
48
- // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
49
-
50
- /* Module Resolution Options */
51
- "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
52
- // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
53
- // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
54
- // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
55
- // "typeRoots": [], /* List of folders to include type definitions from. */
56
- // "types": [], /* Type declaration files to be included in compilation. */
57
- // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
58
- "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
59
- // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
60
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
61
-
62
- /* Source Map Options */
63
- // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
64
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
65
- // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
66
- // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
67
-
68
- /* Experimental Options */
69
- "experimentalDecorators": true /* Required for Lit: https://lit.dev/docs/components/decorators/#decorators-typescript */,
70
- "useDefineForClassFields": false /* Required for Lit: https://lit.dev/docs/components/decorators/#decorators-typescript */,
71
- // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
72
-
73
- /* Advanced Options */
74
- "skipLibCheck": true /* Skip type checking of declaration files. */,
75
- "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
76
- "plugins": [{ "name": "typescript-plugin-css-modules" }]
77
- },
78
- "include": [
79
- "src/main/MEChat.ts",
80
- "declarations.d.ts",
81
- "index.ts",
82
- "./src/WebComponent/"
83
- ]
84
- }
@@ -1,10 +0,0 @@
1
- import { esbuildPlugin } from "@web/dev-server-esbuild";
2
-
3
- export default {
4
- files: "src/**/*.test.ts",
5
- plugins: [esbuildPlugin({ ts: true, target: "auto" })],
6
- nodeResolve: { browser: true },
7
- coverageConfig: {
8
- exclude: ["talk.js", "node_modules/**"],
9
- },
10
- };
@@ -1,48 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const path = require("path");
3
- const Dotenv = require("dotenv-webpack");
4
- const { EnvironmentPlugin } = require("webpack");
5
-
6
- module.exports = () => {
7
- return {
8
- devServer: {
9
- static: "./public/demo",
10
- hot: true,
11
- port: 8000,
12
- },
13
- entry: "./src/main/MEChat.ts",
14
- module: {
15
- rules: [
16
- {
17
- test: /\.tsx?$/,
18
- use: "ts-loader",
19
- exclude: /node_modules/,
20
- },
21
- {
22
- test: /\.(c|sa|sc)ss$/,
23
- use: ["style-loader", "css-loader"],
24
- },
25
- ],
26
- },
27
- resolve: {
28
- extensions: [".tsx", ".ts", ".js", ".css", ".scss"],
29
- },
30
- experiments: {
31
- outputModule: true,
32
- },
33
- output: {
34
- filename: "index.js",
35
- sourceMapFilename: "index.js.map",
36
- path: path.resolve(__dirname, "public/dist"),
37
- library: {
38
- type: "module",
39
- },
40
- },
41
- plugins: [
42
- new Dotenv(),
43
- new EnvironmentPlugin({
44
- LAUNCHDARKLY_CLIENT_ID: "6119b3a2ceeceb24f45c7e66",
45
- }),
46
- ],
47
- };
48
- };