Skip to content

Commit 828e558

Browse files
committed
update build config, to simplify injecting this app into another webpage.
1 parent 76b65d1 commit 828e558

File tree

4 files changed

+162
-9
lines changed

4 files changed

+162
-9
lines changed

package-lock.json

Lines changed: 99 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"devDependencies": {
3030
"@eslint/js": "^9.11.1",
31+
"@types/node": "^22.9.0",
3132
"@types/react": "^18.3.10",
3233
"@types/react-copy-to-clipboard": "^5.0.7",
3334
"@types/react-dom": "^18.3.0",

vite.config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ export default defineConfig({
1414
},
1515
},
1616
build: {
17+
outDir: "dist", // Output directory for Hugo or S3
18+
assetsDir: "", // Place assets in the root of `dist` instead of an `assets` directory
1719
rollupOptions: {
1820
output: {
19-
// Format the entry file names and chunk file names with the version
20-
entryFileNames: `[name]-v${version}.js`,
21-
chunkFileNames: `[name]-v${version}.js`,
22-
assetFileNames: `[name]-v${version}.[ext]`,
21+
// Inline all dynamic imports to ensure a single file output
22+
inlineDynamicImports: true,
23+
manualChunks: undefined, // Disables code splitting by chunks
24+
entryFileNames: `AI-Act-Questionnaire-v${version}.js`, // Output file name for JS with version
25+
assetFileNames: `AI-Act-Questionnaire-v${version}.[ext]`, // Output file name for CSS with version
2326
},
2427
},
28+
assetsInlineLimit: 0, // Prevent asset inlining to avoid extra files
2529
},
2630
});

yarn.lock

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@
280280
resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz"
281281
integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==
282282

283+
"@jridgewell/source-map@^0.3.3":
284+
version "0.3.6"
285+
resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz"
286+
integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==
287+
dependencies:
288+
"@jridgewell/gen-mapping" "^0.3.5"
289+
"@jridgewell/trace-mapping" "^0.3.25"
290+
283291
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14":
284292
version "1.5.0"
285293
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz"
@@ -435,6 +443,13 @@
435443
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz"
436444
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
437445

446+
"@types/node@^18.0.0 || >=20.0.0", "@types/node@^22.9.0":
447+
version "22.9.0"
448+
resolved "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz"
449+
integrity sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==
450+
dependencies:
451+
undici-types "~6.19.8"
452+
438453
"@types/prop-types@*", "@types/prop-types@^15.7.3":
439454
version "15.7.13"
440455
resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz"
@@ -583,7 +598,7 @@ acorn-jsx@^5.3.2:
583598
resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz"
584599
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
585600

586-
"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.14.0:
601+
"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.14.0, acorn@^8.8.2:
587602
version "8.14.0"
588603
resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz"
589604
integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==
@@ -674,6 +689,11 @@ buffer-builder@^0.2.0:
674689
resolved "https://registry.npmjs.org/buffer-builder/-/buffer-builder-0.2.0.tgz"
675690
integrity sha512-7VPMEPuYznPSoR21NE1zvd2Xna6c/CloiZCfcMXR1Jny6PjX0N4Nsa38zcBFo/FMK+BlA+FLKbJCQ0i2yxp+Xg==
676691

692+
buffer-from@^1.0.0:
693+
version "1.1.2"
694+
resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz"
695+
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
696+
677697
callsites@^3.0.0:
678698
version "3.1.0"
679699
resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz"
@@ -734,6 +754,11 @@ comma-separated-tokens@^1.0.0:
734754
resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz"
735755
integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==
736756

757+
commander@^2.20.0:
758+
version "2.20.3"
759+
resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz"
760+
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
761+
737762
compute-gcd@^1.2.1:
738763
version "1.2.1"
739764
resolved "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz"
@@ -1789,6 +1814,19 @@ source-map-js@^1.2.1:
17891814
resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz"
17901815
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
17911816

1817+
source-map-support@~0.5.20:
1818+
version "0.5.21"
1819+
resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz"
1820+
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
1821+
dependencies:
1822+
buffer-from "^1.0.0"
1823+
source-map "^0.6.0"
1824+
1825+
source-map@^0.6.0:
1826+
version "0.6.1"
1827+
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz"
1828+
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
1829+
17921830
space-separated-tokens@^1.0.0:
17931831
version "1.1.5"
17941832
resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz"
@@ -1813,6 +1851,16 @@ supports-color@^8.1.1:
18131851
dependencies:
18141852
has-flag "^4.0.0"
18151853

1854+
terser@^5.4.0:
1855+
version "5.36.0"
1856+
resolved "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz"
1857+
integrity sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==
1858+
dependencies:
1859+
"@jridgewell/source-map" "^0.3.3"
1860+
acorn "^8.8.2"
1861+
commander "^2.20.0"
1862+
source-map-support "~0.5.20"
1863+
18161864
text-table@^0.2.0:
18171865
version "0.2.0"
18181866
resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
@@ -1871,6 +1919,11 @@ uncontrollable@^7.2.1:
18711919
invariant "^2.2.4"
18721920
react-lifecycles-compat "^3.0.4"
18731921

1922+
undici-types@~6.19.8:
1923+
version "6.19.8"
1924+
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz"
1925+
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
1926+
18741927
update-browserslist-db@^1.1.1:
18751928
version "1.1.1"
18761929
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz"

0 commit comments

Comments
 (0)