Skip to content

Commit a1060df

Browse files
committed
Include dev pages in artifacts
1 parent ad6c1ec commit a1060df

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-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": "node scripts/themeable-source",
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:lib": "vite build -c vite.config.pages.mjs"
4041
},
4142
"exports": {
4243
".": "./index.js",

vite.config.pages.mjs

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

0 commit comments

Comments
 (0)