@redzone/taunt-logins-ui-react 0.0.4 → 0.0.5

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 (55) hide show
  1. package/.history/babel.config_20251002171845.json +0 -0
  2. package/.history/babel.config_20251002171847.json +3 -0
  3. package/.history/babel.config_20251002172145.json +3 -0
  4. package/.history/babel.config_20251002172313.json +3 -0
  5. package/.history/babel.config_20251002172415.json +8 -0
  6. package/.history/package_20251002171613.json +40 -0
  7. package/.history/package_20251002171644.json +40 -0
  8. package/.history/package_20251002171740.json +43 -0
  9. package/.history/package_20251002172017.json +43 -0
  10. package/.history/package_20251002172634.json +53 -0
  11. package/.history/package_20251002182812.json +52 -0
  12. package/.history/package_20251002183227.json +34 -0
  13. package/.history/package_20251002183258.json +42 -0
  14. package/.history/package_20251002202514.json +46 -0
  15. package/.history/package_20251002202542.json +46 -0
  16. package/.history/package_20251002202550.json +45 -0
  17. package/.history/package_20251002203503.json +46 -0
  18. package/.history/package_20251002204314.json +45 -0
  19. package/.history/package_20251002213111.json +45 -0
  20. package/.history/package_20251002222438.json +47 -0
  21. package/.history/package_20251002222511.json +45 -0
  22. package/.history/package_20251002222541.json +45 -0
  23. package/.history/src/App_20251002205122.tsx +54 -0
  24. package/.history/src/lib/index_20251002182429.ts +4 -0
  25. package/.history/src/lib/magic_20251002171038.tsx +50 -0
  26. package/.history/src/lib/metamask_20251002171636.tsx +27 -0
  27. package/.history/tsconfig.app_20251002172720.json +28 -0
  28. package/.history/vite.config_20251002182237.ts +19 -0
  29. package/.history/vite.config_20251002182326.ts +19 -0
  30. package/.history/vite.config_20251002182358.ts +19 -0
  31. package/.history/vite.config_20251002182434.ts +19 -0
  32. package/.history/vite.config_20251002182749.ts +26 -0
  33. package/.history/vite.config_20251002182810.ts +26 -0
  34. package/.history/vite.config_20251002184535.ts +36 -0
  35. package/.history/vite.config_20251002184720.ts +41 -0
  36. package/.history/vite.config_20251002184748.ts +37 -0
  37. package/.history/vite.config_20251002184844.ts +37 -0
  38. package/.history/vite.config_20251002201901.ts +45 -0
  39. package/.history/vite.config_20251002202019.ts +47 -0
  40. package/.history/vite.config_20251002202043.ts +47 -0
  41. package/.history/vite.config_20251002202502.ts +47 -0
  42. package/.history/vite.config_20251002203503.ts +43 -0
  43. package/asdf/tsconfig.app.json +28 -0
  44. package/asdf/tsconfig.json +7 -0
  45. package/asdf/tsconfig.node.json +26 -0
  46. package/package.json +21 -15
  47. package/src/App.tsx +2 -2
  48. package/src/lib/index.ts +4 -0
  49. package/src/lib/magic.tsx +2 -2
  50. package/src/lib/metamask.tsx +1 -1
  51. package/tsconfig.json +23 -5
  52. package/tsconfig.node.json +3 -19
  53. package/vite.config.ts +40 -7
  54. package/public/vite.svg +0 -1
  55. /package/{tsconfig.app.json → .history/tsconfig.app_20251002141038.json} +0 -0
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@redzone/taunt-logins": "^0.0.3"
24
+ },
25
+ "peerDependencies": {
26
+ "react": "^18.2.0",
27
+ "react-dom": "^18.2.0"
28
+ },
29
+ "devDependencies": {
30
+ "@eslint/js": "^9.36.0",
31
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
32
+ "@types/node": "^24.6.0",
33
+ "@types/react": "^19.1.16",
34
+ "@types/react-dom": "^19.1.9",
35
+ "@vitejs/plugin-react": "^5.0.4",
36
+ "@vitejs/plugin-react-swc": "^4.1.0",
37
+ "eslint": "^9.36.0",
38
+ "eslint-plugin-react-hooks": "^5.2.0",
39
+ "eslint-plugin-react-refresh": "^0.4.22",
40
+ "globals": "^16.4.0",
41
+ "typescript": "~5.9.3",
42
+ "typescript-eslint": "^8.45.0",
43
+ "vite": "^7.1.7",
44
+ "vite-plugin-css-injected-by-js": "^3.5.2",
45
+ "vite-plugin-dts": "^4.5.4"
46
+ }
47
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^18.2.0",
24
+ "react-dom": "^18.2.0",
25
+ "@redzone/taunt-logins": "^0.0.3"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.5",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^18.2.0",
24
+ "react-dom": "^18.2.0",
25
+ "@redzone/taunt-logins": "^0.0.3"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,54 @@
1
+ // import "./App.css"
2
+
3
+ import { MagicEmailInput } from "./lib/magic"
4
+ import { MetaMaskButton } from "./lib/metamask"
5
+ import { useTaunt } from "./lib/tauntContext"
6
+ import { TauntProvider } from "./lib/tauntProvider"
7
+
8
+ function App() {
9
+ return (
10
+ <TauntProvider
11
+ tauntServiceEndpoint={process.env.VITE_TAUNT_SERVICE_ENDPOINT}
12
+ magicKey={process.env.VITE_MAGIC_KEY}>
13
+ <div
14
+ style={{
15
+ display: "flex",
16
+ flexDirection: "column",
17
+ gap: 8,
18
+ alignItems: "center"
19
+ }}>
20
+ <MagicEmailInput />
21
+ <MetaMaskButton />
22
+ <LogoutButton />
23
+ <TauntDeets />
24
+ </div>
25
+ </TauntProvider>
26
+ )
27
+ }
28
+
29
+ function LogoutButton() {
30
+ const { deets } = useTaunt()
31
+ if (!deets) return null
32
+
33
+ return (
34
+ <button
35
+ className="ml-2 p-2 bg-blue-500 text-white rounded-md"
36
+ type="button">
37
+ Logout
38
+ </button>
39
+ )
40
+ }
41
+
42
+ function TauntDeets() {
43
+ const { deets } = useTaunt()
44
+ return (
45
+ <textarea
46
+ rows={5}
47
+ cols={50}
48
+ value={JSON.stringify(deets, null, 2)}
49
+ readOnly
50
+ />
51
+ )
52
+ }
53
+
54
+ export default App
@@ -0,0 +1,4 @@
1
+ export * from "./magic"
2
+ export * from "./metamask"
3
+ export * from "./tauntContext"
4
+ export * from "./tauntProvider"
@@ -0,0 +1,50 @@
1
+ import { useCallback, useMemo, useState } from "react"
2
+
3
+ import "./styling.css"
4
+
5
+ import { useTaunt } from "./tauntContext"
6
+
7
+ export const MagicEmailInput = ({
8
+ onEmail
9
+ }: {
10
+ onEmail?: (email: string) => void
11
+ }) => {
12
+ const { otpMagicLogin } = useTaunt()
13
+ const [email, setEmail] = useState<string>()
14
+
15
+ const initialised = useMemo(() => email !== undefined, [email])
16
+
17
+ const validEmail = useMemo(() => {
18
+ const validRegex =
19
+ /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
20
+ return email?.match(validRegex) ? email : undefined
21
+ }, [email])
22
+
23
+ const runMagic = useCallback(() => {
24
+ if (!validEmail) return
25
+
26
+ if (onEmail) {
27
+ onEmail(email!)
28
+ } else {
29
+ otpMagicLogin(email!)
30
+ }
31
+ }, [validEmail, onEmail])
32
+
33
+ return (
34
+ <div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
35
+ {initialised && !validEmail && (
36
+ <div style={{ color: "red" }}>Please enter a valid email</div>
37
+ )}
38
+ <input
39
+ className="rdz-input"
40
+ onChange={(e) => setEmail(e.target.value ? e.target.value : undefined)}
41
+ placeholder="Enter your email"
42
+ type="email"
43
+ value={email}
44
+ />
45
+ <button className="rdz-button" onClick={runMagic} type="button">
46
+ Send Magic Link
47
+ </button>
48
+ </div>
49
+ )
50
+ }
@@ -0,0 +1,27 @@
1
+ import { useCallback } from "react"
2
+
3
+ import "./styling.css"
4
+
5
+ import { useTaunt } from "./tauntContext"
6
+
7
+ export const MetaMaskButton = ({
8
+ openMetamask
9
+ }: {
10
+ openMetamask?: () => void
11
+ }) => {
12
+ const { metamaskLogin } = useTaunt()
13
+
14
+ const runMetamask = useCallback(() => {
15
+ if (openMetamask) {
16
+ openMetamask()
17
+ } else {
18
+ metamaskLogin()
19
+ }
20
+ }, [metamaskLogin, openMetamask])
21
+
22
+ return (
23
+ <button className="rdz-button" onClick={runMetamask}>
24
+ Login with Metamask
25
+ </button>
26
+ )
27
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "types": ["vite/client"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+ "erasableSyntaxOnly": false,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noUncheckedSideEffectImports": true
26
+ },
27
+ "include": ["src"]
28
+ }
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.tsx"),
11
+ // name,
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.tsx"),
11
+ name,
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.tsx"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/lib/index.ts"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,26 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve("src", "src/lib/index.tsx"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ fileName: (format) => `taunt-logins-ui-react.${format}.js`
13
+ },
14
+ rollupOptions: {
15
+ external: ["react", "react-dom"],
16
+ output: {
17
+ globals: {
18
+ react: "React"
19
+ }
20
+ }
21
+ }
22
+ },
23
+ server: {
24
+ open: true
25
+ }
26
+ })
@@ -0,0 +1,26 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve("src", "lib/index.tsx"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ fileName: (format) => `taunt-logins-ui-react.${format}.js`
13
+ },
14
+ rollupOptions: {
15
+ external: ["react", "react-dom"],
16
+ output: {
17
+ globals: {
18
+ react: "React"
19
+ }
20
+ }
21
+ }
22
+ },
23
+ server: {
24
+ open: true
25
+ }
26
+ })
@@ -0,0 +1,36 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+ import dts from "vite-plugin-dts"
5
+
6
+ // https://vite.dev/config/
7
+ export default defineConfig({
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve("src", "lib/index.tsx"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ fileName: (format) => `taunt-logins-ui-react.${format}.js`
13
+ },
14
+ rollupOptions: {
15
+ external: ["react", "react-dom"],
16
+ output: {
17
+ globals: {
18
+ react: "React",
19
+ "react-dom": "ReactDOM"
20
+ }
21
+ }
22
+ },
23
+ //Generates sourcemaps for the built files,
24
+ //aiding in debugging.
25
+ sourcemap: true,
26
+ //Clears the output directory before building.
27
+ emptyOutDir: true
28
+ },
29
+ //react() enables React support.
30
+ //dts() generates TypeScript declaration files (*.d.ts)
31
+ //during the build.
32
+ plugins: [react(), dts()],
33
+ server: {
34
+ open: true
35
+ }
36
+ })
@@ -0,0 +1,41 @@
1
+ import path from "path";
2
+ // import react from "@vitejs/plugin-react-swc"
3
+ import react from "@vitejs/plugin-react";
4
+ import { defineConfig } from "vite";
5
+ import dts from "vite-plugin-dts";
6
+
7
+
8
+
9
+
10
+
11
+ // https://vite.dev/config/
12
+ export default defineConfig({
13
+ build: {
14
+ lib: {
15
+ entry: path.resolve("src", "lib/index.tsx"),
16
+ name: "@redzone/taunt-logins-ui-react",
17
+ fileName: (format) => `taunt-logins-ui-react.${format}.js`
18
+ },
19
+ rollupOptions: {
20
+ external: ["react", "react-dom"],
21
+ output: {
22
+ globals: {
23
+ react: "React",
24
+ "react-dom": "ReactDOM"
25
+ }
26
+ }
27
+ },
28
+ //Generates sourcemaps for the built files,
29
+ //aiding in debugging.
30
+ sourcemap: true,
31
+ //Clears the output directory before building.
32
+ emptyOutDir: true
33
+ },
34
+ //react() enables React support.
35
+ //dts() generates TypeScript declaration files (*.d.ts)
36
+ //during the build.
37
+ plugins: [react(), dts()],
38
+ server: {
39
+ open: true
40
+ }
41
+ })
@@ -0,0 +1,37 @@
1
+ import path from "path"
2
+ // import react from "@vitejs/plugin-react-swc"
3
+ import react from "@vitejs/plugin-react"
4
+ import { defineConfig } from "vite"
5
+ import dts from "vite-plugin-dts"
6
+
7
+ // https://vite.dev/config/
8
+ export default defineConfig({
9
+ build: {
10
+ lib: {
11
+ entry: path.resolve("src", "lib/index.tsx"),
12
+ name: "@redzone/taunt-logins-ui-react",
13
+ fileName: (format) => `taunt-logins-ui-react.${format}.js`
14
+ },
15
+ rollupOptions: {
16
+ external: ["react", "react-dom"],
17
+ output: {
18
+ globals: {
19
+ react: "React",
20
+ "react-dom": "ReactDOM"
21
+ }
22
+ }
23
+ },
24
+ //Generates sourcemaps for the built files,
25
+ //aiding in debugging.
26
+ sourcemap: true,
27
+ //Clears the output directory before building.
28
+ emptyOutDir: true
29
+ },
30
+ //react() enables React support.
31
+ //dts() generates TypeScript declaration files (*.d.ts)
32
+ //during the build.
33
+ plugins: [react(), dts()],
34
+ server: {
35
+ open: true
36
+ }
37
+ })
@@ -0,0 +1,37 @@
1
+ import path from "path"
2
+ // import react from "@vitejs/plugin-react-swc"
3
+ import react from "@vitejs/plugin-react"
4
+ import { defineConfig } from "vite"
5
+ import dts from "vite-plugin-dts"
6
+
7
+ // https://vite.dev/config/
8
+ export default defineConfig({
9
+ build: {
10
+ lib: {
11
+ entry: path.resolve("src", "lib/index.tsx"),
12
+ name: "@redzone/taunt-logins-ui-react",
13
+ fileName: (format) => `index.${format}.js`
14
+ },
15
+ rollupOptions: {
16
+ external: ["react", "react-dom"],
17
+ output: {
18
+ globals: {
19
+ react: "React",
20
+ "react-dom": "ReactDOM"
21
+ }
22
+ }
23
+ },
24
+ //Generates sourcemaps for the built files,
25
+ //aiding in debugging.
26
+ sourcemap: true,
27
+ //Clears the output directory before building.
28
+ emptyOutDir: true
29
+ },
30
+ //react() enables React support.
31
+ //dts() generates TypeScript declaration files (*.d.ts)
32
+ //during the build.
33
+ plugins: [react(), dts()],
34
+ server: {
35
+ open: true
36
+ }
37
+ })
@@ -0,0 +1,45 @@
1
+ import path from "path"
2
+ // import react from "@vitejs/plugin-react-swc"
3
+ import react from "@vitejs/plugin-react"
4
+ import { defineConfig } from "vite"
5
+ import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"
6
+ import dts from "vite-plugin-dts"
7
+
8
+ // https://vite.dev/config/
9
+ export default defineConfig({
10
+ build: {
11
+ lib: {
12
+ entry: path.resolve("src", "lib/index.tsx"),
13
+ name: "@redzone/taunt-logins-ui-react",
14
+ fileName: (format) => `index.${format}.js`
15
+ },
16
+ rollupOptions: {
17
+ external: ["react", "react-dom", "react/jsx-runtime"],
18
+ output: {
19
+ globals: {
20
+ react: "React",
21
+ "react-dom": "ReactDOM",
22
+ "react/jsx-runtime": "react/jsx-runtime"
23
+ }
24
+ }
25
+ },
26
+ //Generates sourcemaps for the built files,
27
+ //aiding in debugging.
28
+ sourcemap: true,
29
+ //Clears the output directory before building.
30
+ emptyOutDir: true
31
+ },
32
+ //react() enables React support.
33
+ //dts() generates TypeScript declaration files (*.d.ts)
34
+ //during the build.
35
+ plugins: [
36
+ cssInjectedByJsPlugin(),
37
+ react(),
38
+ dts({
39
+ insertTypesEntry: true
40
+ })
41
+ ],
42
+ server: {
43
+ open: true
44
+ }
45
+ })