File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 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.dev-pages.config.mjs"
3839 },
3940 "exports" : {
4041 "." : " ./index.js" ,
Original file line number Diff line number Diff line change 1+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: Apache-2.0
3+ import react from "@vitejs/plugin-react" ;
4+ import { dirname , resolve } from "node:path" ;
5+ import { fileURLToPath } from "node:url" ;
6+ import { defineConfig } from "vite" ;
7+
8+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
9+
10+ const componentsPath = resolve ( __dirname , "lib/components" ) ;
11+
12+ const globals = { [ componentsPath ] : "components" } ;
13+
14+ // https://vitejs.dev/config/
15+ export default defineConfig ( {
16+ plugins : [ react ( { fastRefresh : false } ) ] ,
17+ build : {
18+ lib : {
19+ entry : resolve ( __dirname , "pages/main.tsx" ) ,
20+ name : "CodeViewComponentsDevPages" ,
21+ fileName : "main" ,
22+ } ,
23+ outDir : "lib/dev-pages/bundle" ,
24+ rollupOptions : {
25+ external : [ componentsPath ] ,
26+ output : {
27+ globals,
28+ } ,
29+ } ,
30+ } ,
31+ } ) ;
You can’t perform that action at this time.
0 commit comments