File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 3535 "build:src:environment" : " node scripts/environment" ,
3636 "build:themeable" : " node scripts/themeable-source" ,
3737 "build:pages:vite" : " vite build" ,
38- "build:pages:tsc" : " tsc -p pages/tsconfig.json"
38+ "build:pages:tsc" : " tsc -p pages/tsconfig.json" ,
39+ "build:pages:bundle" : " vite build -c vite.config.dev-pages.mjs"
3940 },
4041 "exports" : {
4142 "." : " ./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+
4+ import { dirname , resolve } from "node:path" ;
5+ import { fileURLToPath } from "node:url" ;
6+
7+ import react from "@vitejs/plugin-react" ;
8+ import { defineConfig } from "vite" ;
9+
10+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
11+
12+ const componentsPath = resolve ( __dirname , "lib/components" ) ;
13+
14+ const globals = { [ componentsPath ] : "components" , highcharts : "highcharts" } ;
15+
16+ // https://vitejs.dev/config/
17+ export default defineConfig ( {
18+ plugins : [ react ( { fastRefresh : false } ) ] ,
19+ build : {
20+ lib : {
21+ entry : resolve ( __dirname , "pages/main.tsx" ) ,
22+ name : "ChartComponentsDevPages" ,
23+ fileName : "main" ,
24+ } ,
25+ outDir : "lib/dev-pages/bundle" ,
26+ rollupOptions : {
27+ external : [ componentsPath , "highcharts" ] ,
28+ output : {
29+ globals,
30+ } ,
31+ } ,
32+ } ,
33+ } ) ;
You can’t perform that action at this time.
0 commit comments