Skip to content

Commit 5ef6b90

Browse files
committed
Include dev pages in artifacts
1 parent 801da94 commit 5ef6b90

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"build:src:environment": "node scripts/environment",
3535
"build:themeable": "node scripts/themeable-source",
3636
"build:pages:vite": "vite build",
37-
"build:pages:tsc": "tsc -p pages/tsconfig.json"
37+
"build:pages:tsc": "tsc -p pages/tsconfig.json",
38+
"build:pages:lib": "vite build -c vite.config.dev-pages.mjs"
3839
},
3940
"exports": {
4041
".": "./index.js",

vite.dev-pages.config.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
const componentsPath = resolve(__dirname, "lib/components");
12+
13+
const globals = { [componentsPath]: "components" };
14+
15+
// https://vitejs.dev/config/
16+
export default defineConfig({
17+
plugins: [react({ fastRefresh: false })],
18+
build: {
19+
lib: {
20+
entry: resolve(__dirname, "pages/main.tsx"),
21+
name: "CodeViewComponentsDevPages",
22+
fileName: "main",
23+
},
24+
outDir: "lib/dev-pages/bundle",
25+
rollupOptions: {
26+
external: [componentsPath],
27+
output: {
28+
globals,
29+
},
30+
},
31+
},
32+
});

0 commit comments

Comments
 (0)