Skip to content

Commit cc471e7

Browse files
authored
chore: Add dev pages bundle to build artifacts (#100)
1 parent 991c775 commit cc471e7

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"build:src:environment": "node scripts/environment",
3737
"build:themeable": "tsc -p tsconfig.src-themeable.json && node scripts/themeable-source.js",
3838
"build:pages:vite": "vite build",
39-
"build:pages:tsc": "tsc -p pages/tsconfig.json"
39+
"build:pages:tsc": "tsc -p pages/tsconfig.json",
40+
"build:pages:bundle": "vite build -c vite.config.dev-pages.mjs"
4041
},
4142
"exports": {
4243
".": "./index.js",

vite.config.dev-pages.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import { dirname, resolve } from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
6+
import react from "@vitejs/plugin-react";
7+
import { defineConfig } from "vite";
8+
9+
const __dirname = dirname(fileURLToPath(import.meta.url));
10+
11+
// https://vitejs.dev/config/
12+
export default defineConfig({
13+
plugins: [react({ fastRefresh: false })],
14+
resolve: {
15+
alias: {
16+
lodash: "lodash-es",
17+
},
18+
},
19+
build: {
20+
lib: {
21+
entry: resolve(__dirname, "pages/main.tsx"),
22+
name: "ChatComponentsDevPages",
23+
fileName: "main",
24+
},
25+
outDir: "lib/dev-pages/bundle",
26+
rollupOptions: {
27+
external: [/(?:\.\.\/)+?lib\/components/, /^@cloudscape-design\//, "react"],
28+
},
29+
},
30+
});

0 commit comments

Comments
 (0)