File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 3737 "build:themeable" : " node scripts/themeable-source" ,
3838 "build:pages:vite" : " vite build" ,
3939 "build:pages:tsc" : " tsc -p pages/tsconfig.json" ,
40- "build:pages:lib" : " vite build -c vite.config.pages.mjs"
40+ "build:pages:lib" : " vite build -c vite.config.dev- pages.mjs && cp pages/index.html lib/dev-pages "
4141 },
4242 "exports" : {
4343 "." : " ./index.js" ,
Original file line number Diff line number Diff line change @@ -8,14 +8,19 @@ import { defineConfig } from "vite";
88
99const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
1010
11- const chatComponentsPath = fileURLToPath ( new URL ( "lib/components" , import . meta . url ) ) ;
11+ const chatComponentsPath = resolve ( __dirname , "lib/components" ) ;
1212
1313const globalPackages = {
14+ react : "React" ,
15+ "react-dom" : "ReactDOM" ,
16+ "react/jsx-runtime" : "jsxRuntime" ,
1417 "@cloudscape-design/components" : "components" ,
1518 "@cloudscape-design/global-styles" : "globalStyles" ,
1619 "@cloudscape-design/component-toolkit" : "componentToolkit" ,
1720} ;
1821
22+ const globals = { [ chatComponentsPath ] : "chatComponents" , ...globalPackages } ;
23+
1924// https://vitejs.dev/config/
2025export default defineConfig ( {
2126 plugins : [ react ( { fastRefresh : false } ) ] ,
@@ -34,7 +39,7 @@ export default defineConfig({
3439 rollupOptions : {
3540 external : [ chatComponentsPath , ...Object . keys ( globalPackages ) ] ,
3641 output : {
37- globals : { [ chatComponentsPath ] : "chatComponents" , ... globalPackages } ,
42+ globals,
3843 } ,
3944 } ,
4045 } ,
You can’t perform that action at this time.
0 commit comments